selenium tutorial testing tools

Selenium webdriver using Eclipse

To start selenium scripting with Eclipse, make sure you have installed Java and Eclipse.
You can check in Eclipse from Window->Preferences options, if java is installed and configured successfully on Eclipse.
You can also check the java version from command prompt, enter 'java -version' which will display the java version installed on your machine.
Now we will start creating our first program in selenium using java from Eclipse Editor

1.Create new Java Project
[From top menu file->New->Project/Java Project and enter the project name]

2.Create a new Package under Project
[Give any name to the package]

3.Create a new Java class file under the Package
[Give a name to the class]

4. Next add the selenium server Jar files to the Project. Download Selenium Server
[Right click on the Project Name, Mouse over on Build Path and select 'Configure Build Path', Select Libraries tab, Click on Add External Jars and select the selenium server jar from your local machine]

5.Write the script in the Java and execute it.

Please find the below example program to open Google in firefox browser

    import org.openqa.selenium.WebDriver;  
    import org.openqa.selenium.firefox.FirefoxDriver;  
    public class OpenGoogle {  
     public static void main(String args[]){  
      WebDriver driver=new FirefoxDriver();  
      System.out.println("Hello Google...");  
      driver.get("http://google.com");    
     }  
    } 
Selenium Tutorials: 

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.