Selenium locators cheat sheet pdf
As you know, I am keen on every kind of automation especially related to web technologies. So, I enjoy using Selenium WebDriver. You can find lots of materials in my WebDriver Series. A big part of the job of writing maintainable and stable web automation is related to finding the proper element's locators. So, I created the first and most exhaustive Selenium WebDriver cheat sheet dedicated to the locators. I hope that you will find it quite useful. Enjoy! Show Initially, I created the cheat sheet while we developed the first versions of the BELLATRIX automated testing framework. Мost of the stuff in it are still relevant. Default FindElement WebDriver Methods
Default FindsBy WebDriver Attributes
Complete XPath Locators' List
Complete CSS Selectors' List
Online Training
Web Test Automation FundamentalsLEVEL: 1
Duration: 20 hours4 hour per day -50% coupon code:BELLATRIX50 Test Automation AdvancedLEVEL: 2
Duration: 30 hours4 hour per day -20% coupon code:BELLATRIX20 Enterprise Test Automation FrameworkLEVEL: 3 (Master Class) After discussing the core characteristics, we will start writing the core feature piece by piece. Duration: 30 hours4 hour per day -20% coupon code:BELLATRIX20 WebDriver SeriesWhat are the 8 locators in Selenium?Selenium supports 8 different types of locators namely id, name, className, tagName, linkText, partialLinkText, CSS selector and xpath. Using id is one of the most reliable and fast methods of element recognition. Usually, the id is always unique on a given web page.
Which Selenium locator is best?ID locator in Selenium is the most preferred and fastest way to locate desired WebElements on the page. ID Selenium locators are unique for each element in the DOM. Since IDs are unique for each element on the page, it is considered the fastest and safest method to locate elements.
Which locator is slowest in Selenium?ID locator is the slowest.
What are locators in Selenium with examples?The different locators in Selenium are as follows:
By CSS ID: find_element_by_id. By CSS class name: find_element_by_class_name. By name attribute: find_element_by_name. By DOM structure or xpath: find_element_by_xpath.
|