在 Testfx FxRobot 框架中使用 Awaitility - 在节点可见之前不会发生等待

问题描述

在 Testfx FxRobot 框架中使用 Awaitility - 无法等到节点可见 每次在 UI 轮询中未显示 fxid 元素时,它都会抛出未找到的节点。另一件事是保存捕获的快照路径,我不知道如何使用 Image 以及如何在 catch 中提供路径。请帮忙。

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,600,700);
        Capture c=robot.capture(r);
        c.getimage();


    }

    return robot.lookup(controlId).queryAs(TextField.class);

}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)