InternetExplorerDriver is not an inbuilt driver in Selenium:
Unlike FirefoxDriver, InternetExplorerDriver is not an inbuilt driver in Selenium. Instead we have to download the 'IEDriverServer.exe' file separately, apart from downloading Selenium Jar files.
Executing Selenium 3 Automation Scripts on Internet Explorer Driver
In order to execute the Selenium 3 Automation scripts, we need to configure the Java project using the latest version Jar files of Selenium 3 . For compatibility, we need to use the latest version of IEDriverServer.exe
Supported IE Browsers:
- IE Browser versions - 7, 8, 9, 10 and 11
Executing Selenium 3 Automation scripts on IE 11:
Lets practically execute Selenium 3 Automation Scripts on Internet Explorer 11 Browser using the latest version of IEDriverServer.exe:
1.Create a new Java Project in Eclipse IDE as shown below:
2. Create a 'libraries' folder in the project as shown below:
3. Go to http://www.seleniumhq.org/download/ and click on 'Download' option of latest Java version of Selenium 3 as shown below:
4. Observe that a Zip file will be downloaded and extract the download Zip file as shown below:
5. Open the extracted folder and copy the jar file inside the folder as shown below:
6. Paste the copied Jar files into the 'libraries' folder in Java Project as shown below:
7. Open the 'lib' folder inside the extracted folder as shown below:
8. Copy all the Jar files inside the 'libs' folder as shown below:
9. Paste all the Jar files into the 'libraries' folder in Java Project as shown below:
10. Now configure the Jar files in the 'libraries' folder. Right click on the Java Project and select 'Build Path > Configure Build Path' option as shown below:
11. In the resultant 'Properties' dialog, select 'libraries' tab and 'Add Jars' button as shown below:
12. In the resultant dialog, select all the Jar files under the 'libraries' folder and click on 'OK' and 'Apply' buttons until all the dialogs gets closed as shown below:
13. Observe that all the Selenium Jar files got configured and displayed as shown below:
14. Create a new Class in the Java Project as shown below:
15. Create a driver object for InternetExplorerDriver class as shown below:
16. Hover the mouse over the above error message and select the below displayed items to resolve the errors:
17. Observe that the errors got resolved and write the remaining Selenium code to navigate to http://www.omayo.blogspot.com, click on 'Selenium143' link on the page and close the browser as shown below
18. Open Internet Explorer browser in your windows machine and check its version as shown below:
19. Execute the above Selenium code and observe that the code wont be executed on Internet Explorer 11 browser, instead we get an exception as shown below:
20. From the above error message, its clearly mentioned that we have to set the 'webdriver.ie.driver' property. We will write the below code to set the required property:
21. Copy the 'webdriver.ie.driver' from the error message and paste it as shown below:
22. Now, create a 'drivers' folder in the Java Project as shown below:
23. Go to http://www.seleniumhq.org/download/ and click on 32 bit version of latest IEDriverServer.exe download link as shown below:
24. Extract the downloaded Zip file and open the extracted folder as shown below:
25. Copy the IEDriverServer.exe in the above opened folder as shown below:
26. Paste the copied exe file into the 'drivers' folder as shown below:
27. Now provide the path of the pasted 'IEDriverServer.exe' under the drivers folder in the Selenium code as shown below:
28. Now, we have the Java Project configured with the latest version of Selenium 3 Jar files, the IE 11 browser and the latest version of IEDriverServer.exe file along with its path set in the Selenium code. Lets execute the Selenium 3 Automation code as shown below:
29. On executing the above code, IE 11 browser will be launched, User will be navigated to http://www.omayo.blogspot.com application, 'Selenium143' link on the page will be clicked and hence the user will be navigated to http://www.selenium143.blogspot.com page and finally the browser will close.
Conclusion:
In order to execute the Selenium 3 automation scripts on IE 11 browser, we need to use the latest version of Selenium 3, IE 11 Browser and the latest version of IEDriverServer.exe along with IEDriverServer.exe's path set in the Selenium code.
3. Go to http://www.seleniumhq.org/download/ and click on 'Download' option of latest Java version of Selenium 3 as shown below:
4. Observe that a Zip file will be downloaded and extract the download Zip file as shown below:
5. Open the extracted folder and copy the jar file inside the folder as shown below:
6. Paste the copied Jar files into the 'libraries' folder in Java Project as shown below:
7. Open the 'lib' folder inside the extracted folder as shown below:
8. Copy all the Jar files inside the 'libs' folder as shown below:
9. Paste all the Jar files into the 'libraries' folder in Java Project as shown below:
10. Now configure the Jar files in the 'libraries' folder. Right click on the Java Project and select 'Build Path > Configure Build Path' option as shown below:
11. In the resultant 'Properties' dialog, select 'libraries' tab and 'Add Jars' button as shown below:
12. In the resultant dialog, select all the Jar files under the 'libraries' folder and click on 'OK' and 'Apply' buttons until all the dialogs gets closed as shown below:
13. Observe that all the Selenium Jar files got configured and displayed as shown below:
14. Create a new Class in the Java Project as shown below:
15. Create a driver object for InternetExplorerDriver class as shown below:
16. Hover the mouse over the above error message and select the below displayed items to resolve the errors:
17. Observe that the errors got resolved and write the remaining Selenium code to navigate to http://www.omayo.blogspot.com, click on 'Selenium143' link on the page and close the browser as shown below
18. Open Internet Explorer browser in your windows machine and check its version as shown below:
19. Execute the above Selenium code and observe that the code wont be executed on Internet Explorer 11 browser, instead we get an exception as shown below:
20. From the above error message, its clearly mentioned that we have to set the 'webdriver.ie.driver' property. We will write the below code to set the required property:
21. Copy the 'webdriver.ie.driver' from the error message and paste it as shown below:
22. Now, create a 'drivers' folder in the Java Project as shown below:
23. Go to http://www.seleniumhq.org/download/ and click on 32 bit version of latest IEDriverServer.exe download link as shown below:
24. Extract the downloaded Zip file and open the extracted folder as shown below:
25. Copy the IEDriverServer.exe in the above opened folder as shown below:
26. Paste the copied exe file into the 'drivers' folder as shown below:
27. Now provide the path of the pasted 'IEDriverServer.exe' under the drivers folder in the Selenium code as shown below:
28. Now, we have the Java Project configured with the latest version of Selenium 3 Jar files, the IE 11 browser and the latest version of IEDriverServer.exe file along with its path set in the Selenium code. Lets execute the Selenium 3 Automation code as shown below:
29. On executing the above code, IE 11 browser will be launched, User will be navigated to http://www.omayo.blogspot.com application, 'Selenium143' link on the page will be clicked and hence the user will be navigated to http://www.selenium143.blogspot.com page and finally the browser will close.
Conclusion:
In order to execute the Selenium 3 automation scripts on IE 11 browser, we need to use the latest version of Selenium 3, IE 11 Browser and the latest version of IEDriverServer.exe along with IEDriverServer.exe's path set in the Selenium code.
No comments:
Post a Comment