Dear Selenide users/developers,
I have a strange issue, which I cannot explain. Maybe somebody can
give a hint how to approach it the best.
The Java code is meant to wait until the given element becomes
visible (it may not exist at the moment when this line is executed):
$(By.xpath("//table[@id='overview']/tbody/tr[td[contains(@class,
'status')]/a='SEQLCOMP-94684']")).waitUntil(visible,
10000);
The code is executed in two environments:
- Windows7 x64, Firefox v31
- Linux x64, Firefox v31
both are running over Selenide v2.14.
Windows7 environment
always works. I have never seen the
problem like the issue below.
Linux environment sometimes fails. That is: in some cases Unit test
running the code above succeeds, sometimes fails. The ratio is
approx 50/50.
So I believe xPath is correct. I have also doublechecked that xPath
matches a node in HTML, which was dumped together with screenshot
(see attachment) using
FirePath
addon.
The stack trace is:
com.codeborne.selenide.ex.ElementNotFound: Element not found
{By.xpath: //table[@id='overview']/tbody/tr[td[contains(@class,
'status')]/a='SEQLCOMP-94684']}
Expected: visible
Screenshot:
Screenshot: file:/work/workspace/target/selenide-reports/1418221239308.0.png
Timeout: 10 s.
Caused by: NoSuchElementException: Unable to locate
element:
{"method":"xpath","selector":"//table[@id='overview']/tbody/tr[td[contains(@class,
'status')]/a='SEQLCOMP-94684']"}
at
com.codeborne.selenide.impl.AbstractSelenideElement.throwElementNotFound(AbstractSelenideElement.java:530)
at
com.codeborne.selenide.impl.WaitingSelenideElement.throwElementNotFound(WaitingSelenideElement.java:75)
at
com.codeborne.selenide.impl.AbstractSelenideElement.waitUntil(AbstractSelenideElement.java:522)
at
com.codeborne.selenide.impl.AbstractSelenideElement.waitUntil(AbstractSelenideElement.java:486)
at
com.codeborne.selenide.impl.AbstractSelenideElement.invoke(AbstractSelenideElement.java:167)
at
com.codeborne.selenide.impl.WaitingSelenideElement.invoke(WaitingSelenideElement.java:19)
at com.sun.proxy.$Proxy5.waitUntil(Unknown Source)
I could of course catch
ElementNotFound and retry, but I
think the real problem is something different. So I have changed the
code to
$(By.xpath("//table[@id='overview']/tbody/tr[td[contains(@class,
'status')]/a='SEQLCOMP-94684']")).waitUntil(not(hidden),
10000);
and now it works much better (if not perfect), but I think
semantically that means something different: wait until element is
hidden while I want to wait until the element is not shown.
Any ideas are welcomed.
--
With best regards,
Dmitry