Writing your first test script for the IE browser

Now you are all set to write test scripts that run on the Internet Explorer browser. The following is the code that instantiates InternetExplorerDriver:

public class SearchTest {    WebDriver driver;    @BeforeMethod    public void setup() {        System.setProperty("webdriver.ie.driver",                "./src/test/resources/drivers/IEDriverServer.exe");        driver = new InternetExplorerDriver();        driver.get("http://demo-store.seleniumacademy.com/");    }    @Test    public void searchProduct() {        // find search box and enter search string        WebElement searchBox = driver.findElement(By.name("q"));        searchBox.sendKeys("Phones");        WebElement searchButton =                driver.findElement(By.className("search-button"));        searchButton.click();        assertThat ...

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.