Using RemoteWebDriver for Internet Explorer

For executing tests on the Internet Explorer driver, the steps are similar to what we did with the Chrome and Firefox browsers.

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

@BeforeMethodpublic void setup() throws MalformedURLException {    DesiredCapabilities caps = new DesiredCapabilities();    caps.setBrowserName("internet explorer");    driver = new RemoteWebDriver(new URL("http://127.0.0.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 InternetExplorerDriver:

java -jar -Dwebdriver.ie.driver=InternetExplorerDriver.exe ...

Get Selenium WebDriver 3 Practical Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.