Selenium Class 16: Xpath Contains Method | Xpath Text Method in selenium

Опубликовано: 30 Сентябрь 2024
на канале: Testing Tutorialspoint
323
7

Xpath Contains Method | Xpath Text Method in selenium
-------------------------------------------------------

- Contains() method is used for all such web elements whose value can change dynamically.

- The contain feature has an ability to find the element with partial text

syntax:

//tagname[contains(@attribute,constantvalue)]

url: https://opensource-demo.orangehrmlive...

-------------------------
Xpath Text Method:

- XPath text() function is a built-in function of selenium webdriver which is used to locate elements based on text of a web element.

- It helps to find the exact text elements and it locates the elements within the set of text nodes.

- The elements to be located should be in string form.

syntax:

//tagname[text()=’Text of the Web Element’]

url: https://developer.salesforce.com/signup