I'm running a suite of tests in Robot Framework, and while the code runs fine visually, it breaks when run on the XVFB via Jenkins.
The point where the code breaks is Click Element xpath=//*[@id="FullContentPane"]//a[2]
. When run visually, this element locator is able to find the correct element, but when run on the XVFB, it can't find the element and it responds with an Element Not Found
error message.
I have also tried dom=document.getElementsByClassName("fa fa-window-close")[0]
and dom=document.getElementsByTagName("i")[2]
, which get the same result.
Here's the HTML for the element (part of an angular application):
<a href="javascript:;">
<i class="fa fa-window-close">
::before
" Save "
</i>
</a>
I'd also try Click Link href="javascript:;"
, but that's at least the second <a>
element with the same href on the page.
I'm not necessarily interested in how I can click on this element (not that I'd complain if you have another approach that works). I'm more interested in why I can't click on it, so that I can avoid this issue in the future. What is it about XVFB that causes some element locators (and not others) to fail like this?