This content has been marked as final.
Show 3 replies
-
1. Re: JSF, Graphene, Drone, Selenium: difficulties with AJAX events
wlf2kme Jul 19, 2016 3:37 AM (in response to wlf2kme)It would seem that the AJAX events do work, the problem is with implicit or explicit waits in Selenium. I need to wait a specific amount of time, but not on a certain WebElement to appear. The elements are there the whole time, the execution is just too fast.
I'm only able to solve the situation by using Thread.sleep. Which I don't like at all. So new question... What can I use as alternative? I can't wait for a WebElement to appear in most cases, as they're already there, just not filled up with data.
-
2. Re: JSF, Graphene, Drone, Selenium: difficulties with AJAX events
mjobanek Jul 22, 2016 10:22 AM (in response to wlf2kme)Hi,
you can use Predicate and custom timeouts for this. eg.:
Graphene.waitAjax().withTimeout(10, TimeUnit.SECONDS).until(new Predicate<WebDriver>() { public boolean apply(WebDriver webDriver) { return !field.getText().isEmpty(); } });
for more information see: Waiting API - Graphene 2 - Project Documentation Editor
-
3. Re: JSF, Graphene, Drone, Selenium: difficulties with AJAX events
wlf2kme Jul 26, 2016 2:51 AM (in response to mjobanek)Thanks, this does seem like a good solution for the waiting issue.