Showing posts with label Element Locators. Show all posts
Showing posts with label Element Locators. Show all posts

Locator in selenium IDE are used for locating an element on page. Selenium IDE support many types of locators like name, id, CSS and  XPath, dom, ui etc.. and from all of them, mostly used locators are nameidCSS and XPath. Selenium IDE has a facility to set your preferred locator to record it. That

As you know, Locators in selenium webdriver software testing tool are main elements and CSS Locator is another alternative of Xpath element locator, ID or Name locator or any other element locators in selenium webdriver software automation testing tool. Full form of CSS is "Cascading Style Sheets" and it define that how to display HTML elements on webpage of software web application. Click here to read more about CSS. There are few advantages and also few disadvantages of using CSS element locators at

Xpath in selenium is close to must required. XPath is element locator and you need to provide xpath during selenium test script creation. You need to provide any element locator(like id, name, css path, xpath etc.) in target column of selenium IDE software testing tool's window to locate that specific element to perform some action on it and you are already aware about that. In previous post, we have learn about how to identify element id or name of software web application's element . If you have worked with selenium IDE software testing tool then you knows that sometimes elements does not contains id or name. Locating element by Xpath in selenium is the another way of locating element and you can use it as a alternative of id or name of element.

First of all let me introduce you about element locators and why we need to use it. Element locators are useful to identifying GUI elements (button, link, textbox, dropdown, etc..) of HTML page. Selenium requires element locator to identify such elements to perform required action on that specific element. 

There are many different types of element locators available and we will learn all of them one by one. To identifying element's id, you need to install Firebug in your Firefox browser. Generally selenium ID records

"captureEntirePageScreenshot" command

This command is very useful for capture and save full page screenshot. You can use this command anywhere in between. It will store screen shot of current selected browser tab.


New Test
Command Target Value
open http://www.google.com
captureEntirePageScreenshot D:\\selenium.jpg

VIEW CAPTURE SCREENSHOT EXAMPLE IN WEBDRIVER

In above example, "captureEntirePageScreenshot" command will capture and store screenshot of Google home page in "D" drive with file name selenium.jpg. You can change file name and file storing path as you