Skip to main content

Object Identification in Selenium

Selenium Locators Training in Hyderabad
Selenium Locators Training in Hyderabad

What are Locators?



The locator is a command. that tells Selenium IDE which GUI elements. its needs to operate on. Identification of correct GUI elements is to creating an automation script. The identification of GUI elements is more difficult than it sounds. Sometimes working with incorrect GUI elements or no elements at all. Hence, Selenium provides many Locators for locating a GUI element.


Object Identification in Selenium

 



The Testing different applications Application under Test. we need to identify the object made of. it is Web Application or Desktop Application.


  •   Button


  •   Text Box


  •   Link


  •   Drop Down


  •   Radio Button


  •   List Box


  •   Slider


 The Object identification is very important part of automation activity. So the automation should be able to identify the objects for automation purpose.


The identifying objects Selenium uses a concept of Locators. These locators used to identify the objects. which use automating the test cases using Selenium.


Locators: There are some locators present. These are among them.


  •   ID


  •   Name


  •   XPath


  •   CSS


  •   Class


  •   tagName


  •   DOM


  •   Link Text


  •   Filters


Finding an element and confirming the expected result requires locators. Through locator, In Document Object Mode. web page, we identify the object. The 'By' class use in WebDriver to locate the elements.


  •   By.id(id);


  •   By.name(name);


  •   By.xpath(xpath);


  •   By.cssSelector(selector);


  •   By.class(class);


  •   By.tagName(name);


  •   By.linkText(linkText);


  •   By.partialLinkText(partialLinkText);


Here XPath and CSS are the most used locators.


It is very easy to identify the object of the application. Which built on Firefox but same on the other way. if that application made on IE browser then it is pretty difficult to identify the object.


There are different tools available to identify the objects on different browsers. like Firefox/Chrome/IE etc.


  •   Firebug


  •   IE Developer Toolbar


  •   XPath Checker


  •   Fire Finder


If we are using Selenium IDE there are different ways to identifying the objects. By default, Selenium identifies the object using ‘ID’ or ‘Name’.


The order of identifying the object in Selenium IDE is following:


  •   ID


  •   Name


  •   CSS


  •   XPath Attributes


  •   XPath Relative


  •   XPath Absolute

Comments

Popular posts from this blog

Web Driver Architecture​ | Best Selenium Online Training in Hyderabad

Best Selenium Online Training In Hyderabad Introduction​ Selenium WebDriver is one of the most powerful and popular tools of Selenium toolkit. WebDriver extended version to Selenium RC. WebDriver extends its support to many latest browsers and platforms, unlike Selenium IDE . WebDriver also doesn’t need Selenium server to start before execution of the Selenium RC . Selenium RC in aggregation with WebDriver API is Selenium 2.0 . Selenium was so developed to support dynamic web pages and Ajax calls . It also supports various drivers to exercise web-based mobile testing. Architecture​ WebDriver is a web-based testing tool with Selenium RC . The tool built on the fundamental where isolated clients create for each of the web browsers. WebDriver makes direct calls to the Web browser . The entire test script executes in this fashion. WebDriver uses the browsers support and capabilities to automation. Seleni...

Selenium Browser Automation Testing Tool

    Selenium Browser Automation Testing Tool Testing professionals use a variety of automation testing tools to the web applications. Automated testing has made the testing processes much simpler than manual testing. It has accelerated the testing process and improved efficiency. The most powerful open source automation tool available at the moment is Selenium . Advantages of Selenium Browser Automation Testing Tool Based on Java scripting to a large extent tests run in the browser. Like Mozilla, Firefox, and Internet Explorer. Various operating systems like Mac, Windows, and Linux. There is hardly any tool that covers such assortment of platforms. This tool has made it easier to check web applications without putting in extra effort and time. Here are some important advantages of the Selenium automation testing tool Flexibility and Ease of Use: Selenium is an interface creating and executing testing suites. Selenium ’s open source allows t...

Introduction of TestNG framework - Advantages of TestNG over Junit framework

 Introduction of TestNG framework - Advantages of TestNG over Junit framework In Selenium Web Driver training run Selenium scripts using JUnit framework. Until now we have executed seleniumtests but we have not generated reports in JUnit. We are introducing the powerful new testing framework called TestNG . The TestNG framework means Next Generation testing framework. So we are seeing all next generation features available in TestNG. I will talk about advantages of TestNG Framework TrainingIn Hyderabad over Junit. TestNG Framework Training In Hyderabad TestNG is popular JUnit framework used for the Java programming language. The TestNG framework introduced to overcome the limitations of JUnit framework. Most of the automation users are using this framework. Its advantages & more supported features. Until we have executed selenium test script but not even generated test reports. So using this TestNG framework learns to generate test reports. Features of ...