Using Awaitility in Testfx FxRobot framework - Unable to wait till node visible Everytime when fxid element is not shown on UI polling is not happening it is throwing node not found. Another thing is to save the captured snapshot path I am not getting how to use Image and how to provide path in catch. Please help.
public <T extends Node> TextField lookupByIdTextField( String controlId,FxRobot robot) {
try {
with()
.await()
.pollDelay(2, TimeUnit.SECONDS)
.atMost(60, TimeUnit.SECONDS)
.until(() -> (robot.lookup(controlId).queryAs(TextField.class))!= null);
}catch(Exception e)
{
logger.error(e.getMessage());
Rectangle2D r=new Rectangle2D(0, 0, 600, 700);
Capture c=robot.capture(r);
c.getImage();
}
return robot.lookup(controlId).queryAs(TextField.class);
}