Skip to main content

Locators for Selenium Web Driver

As we already discussed that Selenium Web Driver work only with the Web Application. In every Web Application there are several Web Pages. In each Web pages there are several Web Element.

Now the question is what is the Web Element?

Everything that is showing on Web Page is the Web Element. Web Element is the Text Box, Button, Text Are, Radio Button, Checkbox, Link, Images, Browser Button, Text, iFrame, pop up window, pop up screen, Confirmation Box, Alert Box all are Web Element.

For Locate any element we use two add-ons of firefox

  • FireBug: This is the add-ons of firefox. You can download and install it from here
Automation Testing, FireBug, Locators, Selenium Web Driver,


After install it will show like below snapshot in your Firefox browser
Automation Testing, FireBug,  Locators, Selenium Web Driver,

  • FirePath: This is the add-ons of firefox. You can download and install it from here

Automation Testing,  FirePath, Locators, Selenium Web Driver,

After install it will show like below snapshot in your Firefox browser once you will press F12 button 

Automation Testing, FireBug, FirePath, Locators, Selenium Web Driver,

To locate these Web Element on the Web Page , we need  locators. Selenium Web Driver use 8 locators to locate every Web Element on the Web Page. These locators are
  • Id: In this locator select the element with the @id attribute. 
  • Name: In this locator select the element with the @name attribute. 
  • Linktext: Visible text with link that exactly matches with the provided Text.
  • Partial Linktext: Visible text with link that partially matches with the provided Text.
  • Tag Name: Locate element using Tag Name
  • Class Name: Locate element using Class Name
  • CSS: Locate element using CSS Selectors
  • Xpath: Locate element using XPath expression. 

Comments

Popular posts from this blog

Why Jmeter is best option for Performance Testing?

There are multiple tools in market for performance testing of any software but Jmeter is the best solution among all of them due to some reason listed below 1) Jmeter is the open source application so users who use this application will not to pay anything. 2) You can use Jmeter for performance of any web application,  Databases and Web Services (REST and SOAP APIs). 3) Jmeter have the user friendly UI component so it is very easy to use. 4) Jmeter can be used to simulate to put maximum number of concurrent users on a server, network or object to test its strength or to analyze overall performance under different load types. 5) Jmeter also use for functional testing for static( JavaScript and HTML) and dynamic( JSP, Servlets and AJAX) resources. 6) Jmeter provides Verity of graphical representations for performance report so it is easy to understand.

How You Can Test Database?

Now we know the Database Testing which you can learn in my last article. In this article we will discuss about the steps that need to following to test any Database. Database Tester should have some basic knowledge regarding SQL Command like DDL (create/drop),  DML (Insert/Delete/Update) and DCL (Grant/Revoke).

Causes of Software Defects

It is practically impossible that developer develop a bug free software and that software we can deliver without Testing. If the complexity of the software increased then there must be bugs that can harm the users who will use that software.