How to configure IE webdriver on a remote box

I have all my tests running in an ubuntu window. Tests are written in PHP. They work great with firefox driver and chrome driver. I am using a standalone selenium server (selenium-server-standalone-2.25.0.jar) which works in the same field. Recently, I need to write a test against IE platforms. I tried a few things, but until now I am still not sure which is the right way to install the IE driver for my specific scenario.

I tried installing IE with mono in the same ubuntu window, but I had a lot of problems during installation, and after I got rid of these problems and made it so that I could start IE from my command line, it is still didn't work for my tests.

I read this specific documentation here: http://code.google.com/p/selenium/wiki/InternetExplorerDriver and proceeded through the window window until I saw this:

The HTTP server launched by IEDriverServer.exe sets up an access checklist to accept connections only from the local machine and denies incoming connections from remote computers. Currently, this cannot be changed without changing the source code to IEDriverServer.exe. To run the Internet Explorer driver on a remote machine, use the stand-alone remote Java server in conjunction with your equivalent language equivalent of RemoteWebDriver.

so I downloaded selenium-server-standalone-2.25.0.jar on a Windows machine and started it; my IEDriverServer.exe was placed in C: \ windows \ system32 \, which is in my PATH. Then I changed the code in my ubuntu block to point to a selenium server running in a window window. But still no luck.

I did a bit of work on Google, and there are times when people have successfully launched it. But they seem to use java binding or C # binding, which I suppose they are developed in a local field. I did not find a working example that looks like mine:

an ubuntu block in which PHP-based tests trigger a connection to a remote selenium server running on Windows. window with standalone selenium server and with IEDriverServer.exe in PATH

Thanks.

+6
source share
1 answer

I had a similar problem - working on Linux and wanting to run my WD tests against IE 11 - and made it work. The main difference between me and the OP is that my tests are written in Java.

My goal was this:

  • My workstation: Ubuntu 14.04, tests written in Java.
  • Windows: some virtual machines with IE 11.
  • I want to run my tests against IE running in a Windows window from an Ubuntu workstation (so I don’t need to install my entire development environment on a Windows machine).

What I've done:

  • Got Win 7 and IE 11 VirtualBox VM, downloaded from Microsoft ( here ), enabled it.
  • Loaded into the Windows window: (a) Java JRE, (b) Selenium Standalone Server jAR (NOT the “Internet Explorer Driver Server” is also mentioned on this page), (c) the Internet Explorer driver .
  • Set up a host-only network between my workstation and the Windows window. Here is a good description of the process. Although the blog VM is Linux, it works almost the same for Windows VM (use "ipconfig" from the command line instead of "ifconfig" to find out your IP address).
  • In the Windows window, the configured things mentioned on the official page of the Internet Explorer driver are in the required settings section. If they change the link, I insert them here:
  • The IEDriverServer executable file must be downloaded and placed in your PATH.
  • In IE 7 or later, in Windows Vista or Windows 7, you must set the Protected Mode option to the same value for each zone. The value can be turned on or off if it is the same for each zone. To set the protected mode settings, select "Internet Options ..." in the "Tools" menu and click on the "Security" tab. For each zone at the bottom of the tab with the inscription "Enable Protected Mode" will be checked.
  • In addition, for IE 10 and above, you must disable "Enhanced Protected Mode". This option is located on the Advanced tab of the Internet Options dialog box.
  • The browser zoom level must be set to 100% so that the native mouse events can be set to the correct coordinates.
  • For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer being created. For 32-bit installations of Windows, the key that you must check in the registry editor is HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Internet Explorer \ Main \ FeatureControl \ FEATURE_BFCACHE. For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Microsoft \ Internet Explorer \ Main \ FeatureControl \ FEATURE_BFCACHE. Note that the subsection FEATURE_BFCACHE may or may not be, and must be created if it is missing. Important. Inside this key, create a DWORD value named iexplore.exe with a value of 0.

Note. I did not need to place the location of IEDriverServer.exe in PATH and could not find the "Enhanced Protected Mode" in my IE 11 settings (this was not done).

  1. In a Windows window launched from the command line (they should both work, I understood this from the messages on this problem ):
    • java -jar selenium-server-standalone-2.53.1.jar
    • IEDriverServer.exe
  2. Edited the settings section of my tests to use RemoteWebDriver , for example (192.168.56.101 was an IP address only for the Windows host):

     DesiredCapabilities capability = DesiredCapabilities.internetExplorer(); driver = new RemoteWebDriver(new URL("http://192.168.56.101:4444/wd/hub"), capability); 
  3. Run tests from my Ubuntu workstation as usual: mvn test myproject

And it worked! :)

+6
source

Source: https://habr.com/ru/post/925182/


All Articles