Unable to identify the value from xpath expression

Answered

Hi All,

Hope you're doing good.

I'm new to the Intellij tool and to this forum. So please forgive me for my basic knowledge question. 

Currently I'm facing an issue with some XPath expressions. From the below HTML page source code, I would like to extract the First Name, Last Name and Designation. So I wrote the Xpath below. From the chrome browser, I can able to highlight the appropriate element but where as from the Intellij tool I'm unable to capture the values. Kindly help me to resolve the issue. 

 

Sorce Code: 

<span id="Company">
<span id="Employee">
<table border="0">
<tbody>
<tr>
<td>
<span class="form-label">First Name</span>
</td>
</tr>
<tr>
<td>
<span class="form-value">Bruce</span>
</td>
</tr>
</tbody>
</table>
<table border="0">
<tbody>
<tr>
<td>
<span class="form-label">Last Name</span>
</td>
</tr>
<tr>
<td>
<span class="form-value">Wayne</span>
</td>
</tr>
</tbody>
</table>
<table border="0">
<tbody>
<tr>
<td>
<span class="form-label">ID</span>
</td>
</tr>
<tr>
<td>
<span class="form-value">654785</span>
</td>
</tr>
</tbody>
</table>
<table border="0">
<tbody>
<tr>
<td>
<span class="form-label">Designation</span>
</td>
</tr>
<tr>
<td>
<span class="form-value">Security Engineer</span>
</td>
</tr>
</tbody>
</table>
<table border="0">
<tbody>
<tr>
<td>
<span class="form-label">Employment Type</span>
</td>
</tr>
<tr>
<td>
<span class="form-value">Permanent</span>
</td>
</tr>
</tbody>
</table>
</span>
</span>

XPath: 


First Name-> (//span[@id=' Company ']//span[@id=' Employee ']//span[@class='form-value'])[1]
Last Name-> (//span[@id=' Company ']//span[@id=' Employee ']//span[@class='form-value'])[2]
Designation-> (//span[@id=' Company ']//span[@id=' Employee ']//span[@class='form-value'])[4]

 

1 comment
Comment actions Permalink

Hello,

Am I got you right that you use "Evaluate XPath" action and you got "expression did not return any result" message?

0

Please sign in to leave a comment.