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

AutoIt in Selenium Webdriver

    AutoIt in Selenium Web driver Selenium is an open source tool. That designed to automate web-based applications on different browsers. But to handle window GUI and non-HTML popups in the application. AutoIt required as these window based activity are not handled by Selenium . What is AutoIt? AutoIt v3 is a freeware scripting language designed for automating. the Windows GUI and general scripting. the combination of keystrokes, mouse movement and window/control manipulation to automate tasks. It is way not possible or reliable with other languages. AutoIt is very small, self-contained and run on all versions of Windows. The face with no annoying “runtimes” required. In layman’s term, AutoIt is another automation tool. Selenium used for Desktop Automation rather Web Automation. It is a powerful tool. It does not automate desktop windows, button & for. it automates mouse movements & keystrokes too. Selenium IDE recording capability generat...

Jenkins used in maven

  What is Jenkins? The Jenkins is the most important open source continuous process of the combine with another tool. It is cross-platform and it can be used on Windows, Linux, Mac and Solaris environments. It is composed in Java. Jenkins most important usage to check the progress any job which can be any application state.  It stimulates preconfigured actions when an individual step occurs in tasks. The Jenkins allows us to take 1 more step further, and allow us to automate this execution of test cases. A little more work, you can configure such that your tests execute every time after deploys a new build. Checks in code Jenkins build a execute unit tests, now deploys the application to test environment. Jenkins builds and then executes your tests on the newly deployed application. This is essential the CI process that others have mentioned. At this point, the only thing that you need to real worry is the writing of your test automa...