Skip to Main Content
Selenium WebDriver 3 Practical Guide - Second Edition
book

Selenium WebDriver 3 Practical Guide - Second Edition

by Pallavi Sharma, UNMESH GUNDECHA, Satya Avasarala
July 2018
Intermediate to advanced content levelIntermediate to advanced
280 pages
7h 27m
English
Packt Publishing
Content preview from Selenium WebDriver 3 Practical Guide - Second Edition

Converting an existing test script to use the RemoteWebDriver server

Let's take a test script that we have executed locally; that is, where the test scripts and the browser were on the same machine:

@BeforeClasspublic void setup() {    System.setProperty("webdriver.chrome.driver",            "./src/test/resources/drivers/chromedriver");    driver = new ChromeDriver();}

The preceding test script creates an instance of Chrome Driver and launches the Chrome browser. Now, let's try to convert this test script to use Selenium Standalone Server that we started earlier. Before we do that, let's see the constructor of RemoteWebDriver, which is as follows:

RemoteWebDriver(java.net.URL remoteAddress, Capabilities desiredCapabilities)

The input parameters for the constructor ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Selenium WebDriver 3.0 - Second Edition

Mastering Selenium WebDriver 3.0 - Second Edition

Mark Collin
Selenium Essentials

Selenium Essentials

Prashanth Sams
Learn Selenium

Learn Selenium

Unmesh Gundecha, Carl Cocchiaro

Publisher Resources

ISBN: 9781788999762Supplemental Content