EXception occur (element not found @ given xpath ) when try find element by x path in eclipse project using ie driver in maven project , this element is inside iframe, when inspect desired element, I found it in the following structure:
<div id="idName">
<div class="container">
<div>
<p class="v1">..............notice this repeated for many different href
<a href=
<span class="v2".........notice this repeated for many different href
<b>part of label</b>
rest of label
<br></br>
When I used
webelement.findElement(By.xpath("//*[@id='idName']/div/div/p/a")).getAttribute("href"))
this results in exception when run No Such Element Exception
, seems I miss something in the relative XPath
, any ideas ?
Note: i tried to switch driver to iframe before find element but it didn't help and still having exception .
Thanks A lot for any help .