How To Use text() Method In XPath Selenium WebDriver || Java

Опубликовано: 03 Август 2021
на канале: Automation Testing
6,938
55

XPath supports multiple methods or functions and one of such method is text() which is used to locate web elements based on the display text either complete text or partial text. text() method can be used with other starts-with and contains methods as well. Basically text() method/function is very useful when it comes to match the partial or complete display text. There are 3 different syntax where we can write text() method.
1. //tagName[text()='Complete Display text']
1. //tagName[starts-with(text(), 'display text prefix')]
2. //tagName[contains(text(), 'sub string of display text')]

Subscribe to this channel for more Selenium Videos
   / nandhis  

Selenium Webdriver architecture    • Selenium Webdriver Architecture Tutor...  
Install selenium Webdriver    • How To Install Selenium WebDriver For...  
Install selenium Webdriver Maven    • How To Install Selenium WebDriver For...  
Different browser Controllers    • Different Browser Controllers In Sele...  
Difference between get() vs navigate().to()    • How To Open Browser and Application U...  
Difference between close() vs quit()    • Difference Between driver.close vs dr...  
How to handle dropdown    • How To Select Dropdown Value In Selen...  
4 Alternate ways to sendkeys() method    • Alternate Ways For sendKeys Method In...  
First script using Firefox Browser    • How To Write First Selenium Test Case...  
First script using Chrome Browser    • How To Write First Selenium Test Case...  
Webdriver manager    • What Is WebDriver Manager In Selenium...  
Bootrap Dropdown    • How To Handle Bootstrap Dropdown In S...  
Dynamic WebTable    • How To Handle Dynamic WebTable In Sel...  
Broken Links    • How To Find Broken Links In Selenium ...  
Multiple Windows    • How To Handle Multiple Windows In Sel...  
IFrame    • How To Handle Frames In Selenium WebD...  
Nested iFrames    • How To Handle Nested iFrames In Selen...  
getAttribute()    • getAttribute() Method In Selenium Web...  
Scroll up & down    • How to Scroll Down or Up using Seleni...  
Scroll Horizontally    • How To Scroll Horizontally Using Sele...  
ToolTip    • TootlTip Verification In Selenium Web...  
Java15 and selenium3    • Java15 and Selenium3 Trial Demo | Sel...  
PageLoadingStrategy    • Page Loading Strategy In Selenium Web...  
What is WebElement    • What Is WebElement In Selenium WebDri...  
Locators in Selenium - Id    • Locators In Selenium WebDriver - Part...  
Locators in Selenium - name    • Locators In Selenium WebDriver - Part...  
Locators in Selenium - className    • Locators In Selenium WebDriver - Part...  
Locators in Selenium - tagName    • Locators In Selenium WebDriver - Part...  
Locators in Selenium - LinkText & PartialLinkText    • LinkText and PartialLinkText Locators...  
Locators in Selenium - Xpath    • Dynamic XPath In Selenium WebDriver |...  
Generate Dynamic XPath -    • How To Generate Dynamic XPath in Sele...  

~~~~ Thanks For Watching ~~~~

#XPath #Contains #Method #syntax #Selenium #webdriver #automation #testing what is xpath axes, how to use xpath axes, xpath axes methods, xpath axes functions, xpath axes name, how to identify xpath with parent child traverse relationship, how to use preceding sibling in xpath expressions, xpath expression locators, following-sibling xpath axes, selenium xpath traversal parent child preceding-sibling following-sibling descendant, xpath function and axes methods ancestor, preceding-sibling, how to crack selenium interview for experience, how to become an expert in xpath, selenium xpath axis, parent child following preceding ancestor descendant, identify xpath with parent child traverse relationship, preceding-sibling xpath axes, selenium webdriver tutorial, xpath, identify child locators through reference of parent node, xpath element locators, axes methods ancestor, ancestor-or-self, how to identify siblings and traverse back to parent nodes with xpath, 1identify xpath with parent child traverse relationship, xpath axes methods following parent ancestor descendant, advanced webdriver xpath tutorial, what is xpath? how to write xpath?, xpath tutorial for dummies, how to find xpath in chrome for selenium automation scripts, how to use xpath in selenium, how to write xpath to find elements in the webpage, xpath interview questions and answers, xpath interview questions, advanced xpath expressions in selenium, selenium xpath tutorial, dynamic xpath, dynamic xpath in selenium webdriver, xpath tutorial for beginners, selenium tutorial for beginners, selenium testing tutorial, relative xpath, following-sibling, xpath tutorial, xpath in selenium, locators in selenium webdriver, webdriver, xpath in selenium webdriver, general sibling selector, descendant selector, child selector, selenium xpath, xpath, ancestor, following, xpath axes, xpath axes in selenium, xpath axes with examples, xpath axes in selenium webdriver example, xpath axes example in selenium, xpath axes methods in selenium, xpath axes in selenium webdriver, xpath axes in selenium, xpath axes with examples, xpath axes in selenium webdriver example, xpath axes example in selenium, selenium xpath tutorial, xpath axes methods in selenium, dynamic xpath in selenium webdriver, xpath axes in selenium webdriver, xpath tutorial for beginners, selenium webdriver tutorial, selenium tutorial for beginners, selenium testing tutorial, relative xpath, following-sibling, preceding-sibling, child, preceding, self descendant