Tuesday, March 28, 2017

Integration of selenium Jars and first test case with Selenium

Step 1: Download web driver java client from the location.












Step 2: Extract the zip file, place all the jar files where you want to maintain your test wares.







Step 3: Launch eclipse, create a new workspace, and create a new project









Step 4: Select “Java Project”. Give a project name “AutomationForDummy”.

Step 5: Create a new package and then create a new class.





























Step 6: Add external Jars to java build path

Right click on project > select properties > Java build path > Libraries tab > click “Add External JARs”.
  • Add selenium Java jar
  • Add all other jars in libs folder













Step 7: Add following code in your class

       WebDriver driver = new FirefoxDriver();
             
       //Launch the google search engine
       driver.get("http://www.google.com");

       // Print a Log In message to the screen
       System.out.println("Successfully opened google search page");

       //Wait for 5 sec
             
       Thread.sleep(5);
                          
       // Close the driver
       driver.quit();

Step 8: Right click on the window > Run as > Java Application

See the result.


Monday, March 27, 2017

Eclipse download and installation


Step 1: Goto the following page and select the eclipse version which you want to download.

I will prefer to download Indigo.

Step 2: It is critical to have Java, eclipse and OS should all be of same 64 or 32 bit version.

Step 3: After complete installation, click on eclipse.exe.


Step 4: if you get Exit code 13 with following screen shot.



Try adding following line in your eclipse.ini file

-vm
C:\Program Files\Java\jdk1.7.0_60\bin\javaw.exe

Check the complete path of Javaw.exe and add these two lines just before -vmargs.

Step 5: If path is not correct, you will get following error.


Step 7: Click on Eclipse.exe and you will get following window.


And installation is done.