Using Selenium Server and a guest virtual machine requires a lot of setup and configuration. The following sections describe the configuration and test execution process when using Selenium Server.
The following steps describe the process for configuring an Internet Explorer 9 and Windows 7 VM provided by Microsoft.
-
Download a virtual machine from Microsoft by selecting 'IE9 on Win7' with 'VirtualBox' as the platform.
-
Import the virtual machine with VirtualBox.
-
Boot the virtual machine.
-
Setup Selenium Server on the virtual machine.
-
Configure port-forwarding on the virtual machine.
- Open PowerShell running as an Administrator
- Run this command
listenaddress
represents theSELENIUM_SERVER_APP_DOMAIN
, generallylocalhost
listenport
represents the port you expose using Selenium Serverconnectaddress
represents the host IP address (our host-only adapter IP address)connectport
represents theSELENIUM_SERVER_APP_PORT
$ netsh interface portproxy add v4tov4 listenport=3001 listenaddress=localhost connectport=3001 connectaddress=10.100.1.1
-
Disable Windows Firewall on all profiles.
-
In Windows Network and Sharing Center, configure the Local network settings.
-
Verify the machines are connected by pinging the guest virtual machine
- From your computer
$ ping 10.100.1.2
- From the Windows VM
$ ping 10.100.1.1
- From your computer
The following steps are for a macOS/OSX host running a Windows 7 guest with Internet Explorer 9.
- Install
selenium-server
$ brew install selenium-server
- In a bash window, start a
selenium-server
hub
$ selenium-server -role hub
- In a CMD window on the virtual machine, start a
selenium-server
node:
$ java -jar C:\selenium\selenium-server-standalone-2.53.1.jar -role node -hub http://10.100.1.1:4444/grid/register -maxSession 15 -browser browserName="internet explorer",version=ANY,platform=WINDOWS,maxInstances=5 -Dwebdriver=C:\selenium\IEDriverServer.exe -port 5556