Google+

316. Using InternetExplorerDriver for Running our Tests on Internet Explorer Browser






InternetExplorerDriver class is used to run the Selenium WebDriver Automation Tests on Internet Explorer Browser.

Before implementing this on Eclipse IDE, you must make sure that protected mode is enabled for all the modes in Internet Explorer by following the below steps:

1. Open Internet Explorer Browser on your machine.
2. Select Tools -> Internet Options as shown below:



3. Select 'Security' tab in the displayed 'Internet Options' dialog as shown below:



4. Select first zone option 'Internet' and make sure 'Enable Protected Mode' check box option is enabled as shown below:



5. Select the next Zone option 'Local Intranet' and make sure that Enable Protected Mode' check box option is enabled as shown below:



6. Select the next Zone option 'Trusted Sites' and make sure that Enable Protected Mode' check box option is enabled as shown below:



7. Select the next Zone option 'Restricted Sites' and make sure that Enable Protected Mode' check box option is enabled as shown below:






Lets Implement This:

Pre-requisites:

1. Create a new Java Project say 'WebDriver-Project14' in Eclipse IDE
2. Configure the Project to work with Selenium WebDriver
3. Create a package say 'package14' under the newly created project.
4. Create a Java Class file say 'Class14' under the newly created package as shown below:




Actual Steps:

1. Write the following code into the newly created Java Class file as shown below and make sure that you resolve all the errors before going to next step:



2. Save and Run the 'Class14.java' file by selecting the 'JUnit Test' option and observe that the Test got failed with the following error as shown below:




3. Now in order to overcome this error, lets set the path to the driver executable by following the next steps.

4. Open https://code.google.com/p/selenium/downloads/list and download the IEDriverServer.exe by clicking on the IEDriverServer link as shown below:



5. Observe that 'InternetExplorerDriver standalore server for 32-bit IE'  page will be displayed as shown below:



6. Now click on the Download link as shown below:



7. Observe that the ZIP file got downloaded as shown below:



8. Extract the ZIP file as shown below (I use WinRAR software for extracting the ZIP files):



9.  Observe that IEDriverServer.exe file got extracted as shown below:




10. Copy the extracted IEDriverServer.exe file and paste it under the C drive of  your computer as shown below:



11. Copy the  statement System.setProperty("webdriver.ie.driver", "path\\to\\iedriver.exe"); and paste it to the setUp( ) method in our automation code as shown below:



12. Now replace the existing path with the path of the IEDriverServer.exe file which is under the C Drive on your machine as shown below:



13. Now Save and Run the 'Class14.java' file by selecting the 'JUnit Test' option and ensure that Selenium WebDriver Automation Test has Run in Internet Explorer Browser as shown below:





Watch the below video:

Click here to watch the video.

Download this Project:


Click here to download this project and import into Eclipse IDE  on your machine.





Please comment below to feedback or ask questions.

Viewing the source code generated by Selenium IDE in Selenium WebDriver format 
will be explained in the next post.



No comments: