Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Selenium WebDriver

    • 0
    • 2
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 446
    Comment on it

    Selenium Web Driver

    Web Driver is just a JAR file which contains collection of interface and class.

    Web Driver is a web based automation testing tool which uses core Java API to drive the test on the browser. Technically Web Driver is an interface , all the browsers driver classes are implemented as Web Driver interface and also many other interfaces.

    It is a new version of Selenium which removes many drawbacks and issues in Selenium RC. Web Driver as native supports all the browsers and all the APIs of Web Driver are purely object oriented.

    Web Driver supports multiple browsers. For Web Driver it doesn't matter whether their is already opened browser, it launches a new browser for each execution.

    Whenever Web Driver launches all the add-ons are automatically get disabled.

    Class Name in Web Driver:
    alt text

    Web Driver Required Softwares:

    1. WebDriver client library
    2. Supported browser:- IE more than 3.5 version and Mozilla should be more than 6.0 version.
    3. Editor:- Eclipse

    WebDriver code syntax:

    1. Create object to browser and launch empty browser.

    Example: webDriver driver = new FireFoxDriver();

    1. Navigate to application URL.

    Example: driver.get("www.google.com");

    1. Find the element in UI.

    Example: Wb = driver.findelement(By.locatorname);

    If element present in UI, find element method and return web element object, if element not present in UI throws "No such element exception".

    Following Locator's available in WebDriver:-

    1. ID()
    2. Name()
    3. Xpath()
    4. CSS locator()
    5. Link text()
    6. Partial link text()
    7. Class name()
    8. Tag name()

    All the above locators are static methods which are implemented under the 'By' class.

    1. Perform an operation with Web element.

    Example: Wb.sendkeys("admin");
    alt text

    How to include Web Driver APIs to Eclipse?


    1. Open Eclipse with workspace.
    2. Create a Java project.
    3. Create package.
    4. Select source right click --> Build Path --> Click on configure build path --> will get a property window --> click on add external JARs --> import all the Web Driver JAR files from the local drive --> import all the JAR files out of library and then import all the JAR files inside the JAR file.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: