Filters are additional attributes used to distinguish elements with the same name. But the XPath would break when the element structure changes. If not, check out the link mentioned below:. Navigate to Mercury Tours homepage http: They tend to be more complex and require a steeper learning curve.

Uploader: Mor
Date Added: 15 September 2006
File Size: 69.61 Mb
Operating Systems: Windows NT/2000/XP/2003/2003/7/8/10 MacOS 10/X
Downloads: 33530
Price: Free* [*Free Regsitration Required]

Using Firebug, inspect the Password text box in Facebook and notice that it has the same name as the Email or Phone text box. We will access the ‘Email or Phone’ text box first. Though, building a relative XPath is time-consuming and ib difficult as you need to check all the nodes to form the path. Notice that they all have the same name which is “servClass”. Tip the index starts at 0. Sign up to receive new product announcements Send.

It should take you to the Flight Finder page shown below. Let us access the “Economy class” radio button first. Use this when you want to locate an element by class attribute webdrivr . Use this when you know link text used within an anchor tag. Webrdiver complete this form and we will get back to you as soon as possible with a quote.


What do you think are the limitations of Selenium IDE? It is advisable to use an attribute that is unique to the element such as a name or ID. The syntax would be: Navigate to Mercury Tours’ Homepage and login using “tutorial” as the username and password.

Locators in Selenium WebDriver | Selenium Tutorial

Since this tutorial was created, Facebook has changed their Login Page Design. Locating Hyperlinks by Link Text 4.

Will only select anchor elements Useful when testing navigation. Works well only on elements with fixed ids and not generated ones. These examples cover some basics, but in order to learn more, the following references are recommended:.

You should notice that the “Boston to San Francisco” label becomes highlighted. Selenium IDE should be eleement to highlight the orange box as shown below.

They can help you perform actions which are difficult to do with XPath. Locators are the basic building blocks of a web page.


Locators in Selenium IDE: CSS Selector, DOM, XPath, Link Text, ID

Currently working in an MNC. Get the test application from internet: It starts from the root element within the web page or part of the page and goes to identify the target element. Web pages, and the underlying DOM are structured hierarchically.

XPath is a language for traversing the structure of the DOM document object model of the web page. Allows very precise locators. Navigate to Mercury Tours Registration page and inspect the Phone text box.

Types of Element Locators – Web Performance

In such situations, we use Partial Link Text to locate elements. Locating Elements by Class Name 4. Every form has input fields with unique names.

In this tutorial, we will toggle between Facebook, new tours.