DEV Community

Cover image for How to open ie browser in selenium webdriver
CoderLegion
CoderLegion

Posted on • Edited on • Originally published at kodblems.com

How to open ie browser in selenium webdriver

🎉 Before you dive into this article...

🚀 Check out our vibrant new community at CoderLegion.com!

💡 Share your knowledge, connect with like-minded developers, and grow together.

👉 Click here to join now!

Selenium refers to a suite of tools widely used in the testing community when it comes to cross-browser testing. It is considered to be one of the most preferred tool suites for web application automation testing because it supports popular web browsers which makes it very powerful.

Supports many browsers (Google Chrome 12+, Internet Explorer 7,8,9,10, Safari 5.1+, Opera 11.5, Firefox 3+) and operating systems (Windows, Mac, Linux / Unix).

Selenium
Selenium also ensures compatibility with different programming languages: C #, Java, JavaScript, Ruby, Python, PHP. Testers can choose the language in which to design the test cases, which makes Selenium extremely favorable for its flexibility.
It was introduced to the market to overcome the limitations encountered in Selenium RC.

In this part, you will figure out how to run your Selenium Test Contents on IE Program.

Web Pilgrim carries out the WebDriver convention utilizing Web Traveler Driver Worker. The Web pilgrim Driver Worker is the connection between your tests in Selenium and the Web Adventurer Program.

Allow us to consider an experiment in which we will attempt to robotize the accompanying situations in the IE program.

Launch IE program.
Open URL:www.google.com Maximize the program.
Type the worth "java tpoint instructional exercises"
Click on the Inquiry button.
We will make our fourth experiment in a similar test suite (Demo_Test).
Step 1:
Right snap on the "src" organizer and make another Class Document from New > Class. Give your Class name "Fourth" and snap on the "Finish" button.

Step 2:
Open URL: http://selenium-release.storage.googleapis.com/index.html?path=2.48/in your program.

Step 3:
Pick the most recent form and download it according to the working framework you are as of now chipping away at.

For Windows 64 bit, click on the "IEDriverServer x64 2.48.0 zip" download.

The downloaded record would be in zipped design. Unload the substance in a helpful index.

Step 4:
Set a framework property "web driver.ie.driver" to the way of your IEDriverServer.exe record and launch an IEDriver class.

Here is an example code to do that.

//Framework Property for IEDriver
System.setProperty("webdriver.ie.driver", "D:\IE Driver Server\IEDriverServer.exe");
/Start up an IEDriver class.
WebDriver driver=new InternetExplorerDriver();
Step 5:
Presently the time has come to code. We have installed remarks for each square of code to clarify the means unmistakably. 1.

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

public class Fourth {
public static void main(String[] args) {
/Framework Property for IEDriver
System.setProperty("webdriver.ie.driver", "D:\IE Driver Server\IEDriverServer.exe");
/Start up an IEDriver class.
WebDriver driver=new InternetExplorerDriver();
/Dispatch Site
driver.navigate().to("http://www.google.com/");
/Augment the program
driver.manage().window().maximize();
/Snap on the hunt text box and send esteem
driver.findElement(By.id("lst-ib")).sendKeys("javatpoint instructional exercises");
/Snap on the hunt button
driver.findElement(By.name("btnK")).click();
}
}
Hope you liked the post!

Top comments (0)