Software Testing & Quality Assurance
Saturday, October 20, 2018
Using 'text()' Method in 'contains()' Method
Syntax to use text() method in contains() method is given below:
//div[contains(text(), 'text')]
For example:
//a[contains(text(), 'ac')]
Here,
//a[contains(text(), 'ac')]
searches all the 'a' elements which contains 'ac' as attribute text value.
No comments:
Post a Comment
Newer Post
Older Post
Home
View mobile version
Subscribe to:
Post Comments (Atom)
Double Slash ' // ' After Double Slash ' // ' In XPath
What is XPath?
XPath is defined as XML path. As XPath is a query language which is based on the tree representation of the XML document, it provides th...
XPath Using 'contains()'
When an attribute of an element is dynamic then one can use 'contains()' to select the element by using the constant part of the ...
XPath Using 'text()'
'text()' is a method in XPath expression which is used to form a locator based on the text available on a webpage Syntax: //ta...
No comments:
Post a Comment