About Me

Page views

Powered by Blogger.

Followers

Wednesday, 29 April 2015



package dayOne;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class TestApp {

public static void main(String[] args) throws InterruptedException {

WebDriver d1 = new FirefoxDriver();
d1.get("https://www.google.co.in");

WebDriver d2 = new FirefoxDriver();
d2.get("http://www.bbc.com");

        System.out.println(d1.getTitle());
                System.out.println(d2.getTitle());
            
                Thread.sleep(5000L);
       
       d1.quit();
       d2.quit();
}
}





Configure Eclipse with Selenium WebDriver :


Select WorkSpace on Eclipse start up

Open Eclipse IDE



Create new Java Project from File > New > Project .


Select Java Project and click Next.




Create a new Package

Right click on Project name ‘Estore‘ and select New > Package.

Give your Package name ‘automationTest‘ and click on Finish button.


Give your Class name ‘FirstTest‘, check the option ‘public static void main‘ and click on Finish button.

Now your Eclipse window will looks like

Add External Jars to Java build path

 Right click on Project ‘Estore‘ > Select Properties > Java build path. Then navigate to Librariestab and click Add External JARs.


Click OK.



Setup WebDriver Client :

Download WebDriver Java client :

Click Here to go on WebDriver Java client driver download page for webDriver download file.


Save the zip file to your Computer


There will be ‘libs’ folder, 2 jar files and change log in unzipped folder as shown in bellow figure. We will use all these files for configuring webdriver in eclipse.




Set up Eclipse 

Go To http://www.eclipse.org/downloads/

Type of version of your OS you have. If your computer is a 64 bit Windows , select Windows 64 and if you have a 32 bit Windows, select Windows 32 bit.



Save the .zip file to your disk.



You have downloaded the Eclipse archive you will need to Extract the zip file, which will create the unzipped Eclipse folder.


 
 Extract the archive to the root of C: drive, thus creating the folder “C:eclipse”, or just moved the extracted eclipse folder to the root of C: drive if you extracted it already.








Open the eclipse folder.
You can double click on the file to run Eclipse.



















Create a work-space folder where you will contain all the program files you create.




Setup Java : 
Install Java on Computer :You need to install JDK  in your system.
“how can I download java”. Click  Install JDK  to download Java and install it in your system. 








.you have selected download, accept the terms of service and choose the correct OS corresponding for the specific JDK.






.  Save the .exe file to your disk.










Click Run.












Click the Next button to continue the installation.













Next screen you will encounter some options. Just leave these alone and click Next unless you know what you are doing.

















Next




Click close on the last dialog. This will complete Java installation process.

Wednesday, 22 April 2015

Selenium WebDriver (2.0) :
1. Works on latest versions of almost all browsers - Firefox, IE(6,7,8), Opera, Chrome.
2. No server required to start.
3. No Record and run.
4. WebDriver is Purely Object oriented API.
5. WebDriver can test iphone/Android applications.
6. Webdriver can move mouse cursor .
7. Interacts natively with browser application.
8. WebDriver is faster than Selenium RC .
9. WebDriver can support the headless HtmlUnit browser .
10. WebDriver's architecture is simpler than Selenium RC's It controls the browser from the OS level .

Selenium Remote Control (RC) :
1. Selenium RCWorks on almost all browsers.Does not work on latest version of firefox/IE .
2. . Server is required to start .
3. No Record and run .
4. Less Object orinted API .
5. Cannot test iphone/Android applications .
6. Cannot move mouse with it .
7. Core engine is Javascript based .
8. Its a simple and small API .
9. No Listeners .
10. Selenium RC automatically generates an HTML file of test results .
 

Selenium IDE (Integrated Development Environment):
1. Record and run tool .
2. Works only on mozillafirefox .
3. Core engine is Javascript based .
4. No server required to start .
5. Not at all object oriented .
6. Cannot move mouse with it .
7. Cannot test iphone/Android applications .
8. No Listeners .
9. Very simple to use. If using User extension, you require knowledge on javascript which makes the work a little bit tough.
10. It must only be used as a prototyping tool
 

Tuesday, 21 April 2015

About Selenium
Selenium is a software testing framework for the web that facilitates the automation of browsers.Selenium is not just a single tool but a suite of software's, each catering to different testing needs of an organization. Selenium was created by Jason Huggins in 2004 It has four components.
1. Selenium Integrated Development Environment (IDE)
Selenium IDE is a simple but powerful Firefox extension that lets users record and replay sets of browser interactions as test cases. Shinya Kasatani of Japan created Selenium IDE .

2. Selenium Grid: Selenium Grid is a server that allows tests to use web browser instances running on remote machines. It allows the Selenium RC solution to scale for large test suites and for test suits that must be run in multiple environments. Different tests can be run at the same time on different remote machines. Selenium Grid was developed by Patrick Lightbody
3. Selenium RC or Remote Control: Selenium RC was the main Selenium project for a long time before the Selenium Webdriver merge brought up Selenium 2, the newest and more powerful tool. create a server by Paul Hammant .
4. Selenium Web Driver : The WebDriver proves itself to be better than both Selenium IDE and Selenium RC in many aspects. It implements a more modern and stable approach in automating the browser's actions. WebDriver, unlike Selenium RC, does not rely on JavaScript for automation. It controls the browser by directly communicating to it.
The supported languages are the same as those in Selenium RC.
Java
C#
PHP
Python
Perl
Ruby

  • Why Selenium
Selenium is an open source tool with Corporate backing
Selenium deploys on Windows, Linux, and Macintosh platforms
It allows recording, editing, and debugging tests.
Tests can then be run against most modern web browsers.
Recorded tests can be exported in most language e.g. html, Java, .net, ruby , python etc.

Popular Posts

Copyright © Learn Selenium Yourself | Powered by Blogger
Design by Duan Zhiyan | Blogger Theme by NewBloggerThemes.com