To run a test on Selenium server, we need to use RemoteWebDriver
. The Remote
class in the Selenium Python binding acts like a client and communicates with the Selenium server to run the tests on a remote machine. We need to use this class to instruct the Selenium server as to what configurations are needed to run a test on a remote machine and commands to run on selected browsers.
In addition to the Remote
class, we need to set desired_capabilities
, that is the browser, operating system, and any other configuration that we want to communicate to the Selenium standalone server to run the test. In this example, we will specify a platform and browser name as the desired capabilities required to run the test:
desired_caps = {} desired_caps['platform'] = 'WINDOWS' desired_caps['browserName'] = 'firefox'
Next, we will create an instance of the Remote
class and pass desired_capabilities
. When the script is executed, it will connect to the Selenium server...