Selenium Basic

8:45 PM 4 Comments



Selenium WebDriver:
-------------------------------

Selenium WebDriver is an web-based automation tool useful to test the applications launched using
the browsers.(IE,Chrome,Firefox,Android,IOS,Safari,Opera)

Selenium Webdriver doesn't help us in automating the desktop based applications

FirefoxDriver is the class useful to automate on FirefoxBrowser

InternetExplorerDriver is the class useful to automate on IE Browser

ChromeDriver is the class useful to automate on Chrome Browser

Pre-req for selenium WebDriver:
------------------------------
Selenium-java-2.44.0.jar in October 2014 
lib/*.jar

All these jars are added to the build path of the Selenium project


jar contains .class files
srcs.jar contains .java files


Selenium has 4 components:
---------------------------
1. IDE - Recording and playback
2. RC - Outdated
3. WebDriver- Currently in use
4. Grid- Useful to test the web applications on remote desktop by without copying the source code.



Selenium is mainly useful to perform cross browser testing.


Verify the Title of the Page:
-------------------------------
1. Open/Launch browser-> FirefoxDriver driver = new FirefoxDriver();
2. Enter url(http://www.google.com)->           driver.get("http://www.google.com");
3. Verify the title of the page                 String expected="Google";
Expected="Google"
Actual =Verify manually                          String actual = driver.getTitle();

if(actual.equals(expected))
{
syso("TestCase passed");
}

else
{
syso("Testcase failed");

}
Selenium API
------------------

http://selenium.googlecode.com/git/docs/api/java/index.html

FirefoxDriver is an class implementing the WebDriver Interface.
//Superclass s  = new SubClass();
WebDriver driver = new FirefoxDriver();
driver.get();
driver.getTitle();

InternetExplorerDriver   is an class implementing the WebDriver Interface.
         WebDriver driver = new InternetExplorerDriver();
driver.get();
driver.getTitle();

ChromeDriver is an class implementing the WebDriver Interface.
WebDriver driver = new ChromeDriver();
driver.get();
driver.getTitle();

firebug url -> https://addons.mozilla.org/en-US/firefox/addon/firebug/

firepath url ->https://addons.mozilla.org/en-US/firefox/addon/firepath/


4 comments:

Thanks for the valuable basis information.

Thanks for the valuable basic information.

Bandekar said...

Thanks, Can u give me Sudheer your personal email

Umesh

mercyroy said...

Nice way of expressing your ideas with us.
thanks for sharing with us and please add more information's.
Salesforce Training in Thirumangalam
Salesforce Training courses near me
Salesforce Training in Vadapalani
Salesforce Training in Amjikarai