Saturday, January 3, 2015

Running Selenium Webdriver tests on Internet Explorer browser

So finally added support to execute tests on Internet Explorer browser also in my github project https://github.com/lalit-k/selenium-java-tests.

3 Simple steps to add Internet Explorer support in Selenium Webdriver project:
  1. Download the IEDriverServer.exe , you can download the latest version from http://selenium-release.storage.googleapis.com/index.html for your target operating system.[download url may change, you can google latest if it changes]
  2. Extract the IEDriverServer.exe from the downloaded zip, and place in your project resources folder.
    IEDriverServer.exe
  3. Now, go to the Driver script where you are initializing the IEDriverServer and add the below code line to initialize the IEDriverServer.

System.setProperty("webdriver.ie.driver", <full system path of the IEDriverServer.exe. Example: c:\tests\resources\IEDriverServer.exe>);
WebDriver driver = new InternetExplorerDriver();

Tip : you can use the "System.getProperty("user.dir");" to get the current working directory and then append the path to IEDriverServer.exe
System.getProperty("user.dir")
You can also view the complete code changes for your reference at https://github.com/lalit-k/selenium-java-tests/commit/d1dc4cd3f878d64a4119fc0d6297df026a07cf5a

No comments:

AWS Certified Solutions Architect Associate - AWS Introduction - Questions

All the Best !!! Show Result !! Try Again !! ×