Wednesday 6 May 2015

How to execute script using web driver API in IE browser?



To run selenium web driver in IE browser, we need to download Internet Explorer Driver Server

From http://docs.seleniumhq.org/download/  section is “The Internet Explorer Driver Server”
First of all, download latest version of IEDriver server for web driver API. Download latest version server location from Download IEDriver Server
Note: Select the IEdriver server based on your working environment as there are two different zip files for both 32 and 64 bit operating system. If you are working on windows 32 bit system, please choose and click on IEDriverServer_Win32_2.39.0.zip to download
Save the downloaded file to your local machine any location and set the path in to test script.
In you test script you need to set the system property for IE driver as
System.setProperty("webdriver.ie.driver", "pathofchromedriver\\IEDriverServer.exe");
Kindly get the below example program for running web driver API in IE browser and give the exe path like below

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class ieBrowserTesting {
        public static void main(String args[])
        {
               System.setProperty("webdriver.ie.driver", "E://IEDriverServer.exe");
                 WebDriver driver=new InternetExplorerDriver();
               driver.get("http://silenumnmisc.blogspot.com");      
        }
}

No comments:

Post a Comment