How to Run Selenium WebDriver Script in Internet Explorer browser
Executing Selenium WebDriver Script in Internet Explorer Browser:
Here in this post, we see how to run Selenium WebDriver Script in Internet Explorer Browser. Moving forward, we need to have IEDriverServer.exe and Selenium WebDriver.
Assuming that you have already Installed Selenium WebDriver.
If you want to install Selenium WebDriver, click on the link below to install Selenium WebDriver in few clicks.
How To Download And Install Selenium WebDriver
Each and every browser has its own Driver to execute Selenium WebDriver Scripts. Selenium WebDriver supports browsers such as Mozilla Firefox, Google Chrome, Internet Explorer, Opera, Safari etc.,
Here we are going to see how to run Selenium WebDriver Script in Internet Explorer Browser.
What is IEDriver and What it does?
The InternetExplorerDriver is a standalone server which implements WebDriver’s wire protocol. It is a separate executable that WebDriver uses to control Internet Explorer. This executable starts a server on local system to run the Selenium WebDriver Test Scripts.
Also find,
Steps to run Selenium WebDriver Script in Internet Explorer Browser
Step 1: Download IEDriverServer.exe
Click here to download Internet Explorer driver
Download the latest release of Internet Explorer driver which is compatible to your test environment. Unzip the downloaded compressed file and keep it somewhere on a known location on your system.
Step 2: Executing the Test Script in Internet Explorer Browser
Find the sample script (using Java) mentioned below to run test script in Internet Explorer browser. Execute it to run the test in Internet Explorer browser which will first open Internet Explorer browser and then open the appropriate URL mentioned in the script
Quick note:
To launch Internet Explorer Browser, we have to do as mentioned below:
1. Set a system property “webdriver.ie.driver” to the path of executable file “IEDriverServer.exe“. If you miss this, you will face an error “The path to the driver executable must be set by the webdriver.ie.driver system property“.
2. Instantiate a Internet Explorer Driver class
package rules; import org.openqa.selenium.WebDriver; import org.openqa.selenium.ie.InternetExplorerDriver; public class stmtest { public static void main(String [] args) throws InterruptedException{ //System.setProperty("webdriver.ie.driver",path of executable file "IEDriverServer.exe") System.setProperty("webdriver.ie.driver", "D://Selenium Environment//IEDriverServer_x64_2.53.1//IEDriverServer.exe"); //Initialize InternetExplorerDriver Instance. WebDriver driver = new InternetExplorerDriver(); driver.get("https://www.softwaretestingmaterial.com/software-testing-interview-questions-free-ebook/"); System.out.println("Selenium Webdriver Script in Internet Explorer browser | Software Testing Material"); driver.close(); } }
In this process of launching IE browser using Selenium WebDriver, you may face few errors. Click on the link below to find the solutions for some of the common errors.
Common errors while launching IE Driver using Selenium WebDriver.