How to configure Selenium WebDriver

To configure the selenium on your system, follow the below given steps-

  • Java should be installed on your system.

Java

Eclipse

Eclipse1

  • Create a java project.

JavaEE

  • Select Java Project > Click on Next button > Enter Gmail in Project Name edit field. > Click on Next button > Click on Finish button.

Eclipse2

  • Now configure the Selenium WebDriver API with your Gmail project.
  • Select the Gmail project and right click > Select Build Path > Click on Configure Build Path…>Click on Add External JARs… button > Browse the extracted Selenium folder and include all Executable Jar file > Click on OK button.

Project

  • Now selenium is configured with your java project.
  • Create a Login class.

Class

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

public class Login {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub

WebDriver browser;

browser = new InternetExplorerDriver ();

browser.get(“http://www.gmail.com”);

}

}

Script

  • Press ctrl+f11.
  • Now you are ready to write your own code to automate your web application.

How to Launch IE browser with Selenium WebDriver on Windows 7

Steps:

 SEL

  • Add the path of downloaded zip file in Environment Variable.
  • Sub Steps: Start > Computer (Right Click on it) > Click on ‘Properties’ > Click on Advanced system settings > Click on ‘Environment Variable’ button > Click on ‘New’ button which displays under ‘System variables’ > Give Variable name: webdriver.ie.driver > Give full path of downloaded IE Driver Server folder in ‘Variable value’ > Click OK > Click OK > Click OK.

EV

  • Open IE Browser > Tools > Internet Options > Security > Check the Enable Protected Mode (require restarting Internet Explorer) check box.

Now we can open IE browser with the help of Selenium WebDriver.