0

I have my robotframework setup on my PC. I would like to connect to a remote windows client, have it open a browser and access a URL. Verify that the pages has loaded. Pretty basic but since I am new to RF, I wanted to know how that would work. For Linux machines, I would use the SSHLibrary and just execute commands (wget) but for the windows machine, I need to use the browsers.

  1. Do I need RF installed on the destination client RDP?
  2. Do I need the webdrivers for each browser on the client RDP?
  3. How would I go about logging in the Windows machine through RDP?
  4. After Logging in with RDP, I run the same "open broswer" with broswer and URL?

Thanks!!!

sprunknwn
  • 37
  • 8
  • Why do you need to connect to remote windows client? Is it essential to your test? Wouldnt it be sufficient to run the test on the windows pc directly? – Jiri Janous Feb 17 '21 at 13:52

1 Answers1

1

The use case you describe - a browser to be opened & controlled on a remote machine, is precisely what Selenium solves.
Though in day-to-day work or debugging we are usually starting a local browser, SE is preliminary designed for remote execution. So head to www.selenium.dev, and focus on the Grid - that's the component you are after.

I'm that approach, answers to your specific questions:

  1. no, you need Robot Framework and selenium library on the local machine, and only selenium & webdriver on the remote.
  2. you don't need the drivers on the client - the selenium library is all you communicate with in your code; you need them installed in the remote only.
  3. on the local you will get the logs of the webdriver commands execution; actual browser manipulation logs are only on the remote and the hub (but these are really debugging ones, everything high-level for the functional execution is local).
  4. you don't really log into RDP with this approach (RDP is totally out of the picture here), and yes - your code is the same as running on local browser - Open Browser, Get Text, etc - but, executed on a remote machine.

If you want to see why 1) and 2), head to the answer over here (shameless plug )

Todor Minakov
  • 19,097
  • 3
  • 55
  • 60
  • Hi there and thank you so much for the detailed response. – sprunknwn Feb 23 '21 at 09:36
  • I am kind of new at this so forgive me if my questions seem too simple. I still don't understand how I implement this Grid into RF. Is there another library I need to load to get additional keywords? I couldn't find any keywords in SeleniumLibrary that open a remote connection and run multiple commands on it. Do you have to have an example test case of something like that? couldn't find any Grid implementation with RF anywhere. Thanks in advance! – sprunknwn Feb 23 '21 at 09:49
  • What I'm basically testing is a gateway. I have a client behind a gw and I want to open a browser and test benign and malicious websites. The tests would be something like this - 1. connect to remote machine (if this is needed). 2. open browser (either ff/chrome/edge) 3. enter url 4. verify page was loaded/blocked 5. maybe take a screenshot. Its simple enough when I do it on my own RF PC. how do I do that on a remote windows PC? (also quite easy to run commands through SSHLibrary on a remote linux machine with wget/curl for example). For win10 I need to use the browser to simulate UX. – sprunknwn Feb 23 '21 at 09:53
  • Selenium Grid is not a RF component (or library) - it's a standalone product. So google not how to implement grid with RF, but just grid by itself. It's basically a server, that controls execution machines - which run browsers. Your client - RF - connects to the Grid, and declares it wants a machine of type X - Chrome, on Windows for example, and if the Grid has such - uses it. For the client (Robot Framework), that's transparent - you just provide to `Open Browser` a `remote_url` argument - which is the IP of the Grid, and all commands onward are done on a remote browser. – Todor Minakov Feb 23 '21 at 14:21
  • Thanks you for the detailed response! Just wanted to update that it works and in the following way for future reference - selenium server needs to be run on the Windows 10 Client (either with the default 4444 port or any other port of your choosing) - java -jar selenium....jar After that you need to have the relevant webdriver in a directory on the windows machine and in the PATH environment variable. Then you can use the open browser with the remote_url argument of the full selenium server url - remote_url=http://${ClientIP}:4444/wd/hub Thanks! – sprunknwn Apr 08 '21 at 13:45