Learning Selenium – Writing your first test case Hello World

In this post, Hello world program explained by opening www.google.com web URL in chrome browser.

Prerequisite: You should have Eclipse and JDK setup, if not refer below link and do the initial setup.

Refer this link to install Eclipse and JDK.
https://digitalappconsultancy.com/site/learning-java-hello-world-example/

Step 1: Download and Configure Selenium Jar files
Go to below link and download Selenium Jar files and copy them in to lib folder of you eclipse project.

http://www.seleniumhq.org/download/

Step 2: Download and Configure Chrome Web Driver
Go to below link and download Chrome Web Driver for testing browser, copy the file in to lib folder of your eclipse project.
Note: If you are using Apple Mac system or any Linux system, make sure the file is having permissions 777 (i.e execute mode)

http://www.seleniumhq.org/download/

Code developed in this tutorial provided below:

import org.openqa.selenium.chrome.ChromeDriver;

public class HelloWorld {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        
        System.setProperty("webdriver.chrome.driver", "/Users/Niranjan/My Briefcase/My Development/eclipse_learning/SeleniumLearning/lib/webdrivers/chromedriver");
        
        ChromeDriver driver = new ChromeDriver();
        driver.get("http://www.google.com");

    }
}

Refer YouTube tutorial with detailed explanation

If you feel this video is useful, Please share it with your friends on Facebook, twitter Google plus etc.

For further reading refer Java Selenium Programming Category posts.

Learning Selenium Java Hello World Example
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *