Home → Practice 5 |
Next Exercise >> | |
|---|---|---|
| Step 1: Read XPath Question → Step 2: Check HTML Source Code → Step 3: Enter XPath Syntax in O/P Box | ||
Q1. Find Coffee Item with Text() function
Q2. Find Tea Item with Text() function
Q3. Find Milk Item with Text() function
Q4. Find Email with Text() function
<h1 id="h1" name="header">Heading 1</h1>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
<label class="form-label" id="userEmail-label">
Email
</label>
Using text()
//*[text()='testdata']
The text() function in XPath can be used to select the text content of an element.