Using RemoteWebDriver for Firefox

Using the Firefox browser to execute our test scripts is similar to using the Chrome browser, except for a couple of variations in how GeckoDriver is launched.

Let's see this by changing the test script that we used for the Chrome browser to the following script, using "firefox":

@BeforeMethod
public void setup() throws MalformedURLException {

DesiredCapabilities caps = new DesiredCapabilities();
caps.setBrowserName("firefox");
caps.setCapability("marionette", true)
;

driver = new RemoteWebDriver(new URL("http://10.172.10.1:4444/wd/hub"), caps);
driver.get("http://demo-store.seleniumacademy.com/");

}

Before you try to execute this code, restart Selenium Standalone Server to use GeckoDriver:

java -jar -Dwebdriver.gecko.driver=geckodriver selenium-server-standalone-3.12.0.jar

Try executing the preceding test script now, and you should see the Firefox browser getting launched and executing your test commands. Selenium Standalone Server has started GeckoDriver, created a connection to it, and started executing the test-script commands. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.70.131