Selenide等待窗口标题文本

时间:2017-06-08 10:40:06

标签: java selenium wait assertion selenide

我想了解如何在selenide / selenium中使用窗口标题文本为服务员设置断言

类似的东西:

public override ActionResult Index(RenderModel model)
{
     var value1 = Request["value1"];
     var value2 = Request["value2"];
     var value3 = Request["value3"];
     ...
}
你可以帮我吗?

1 个答案:

答案 0 :(得分:0)

像这样解决:

{ ...
     await().atMost(timeOut, SECONDS).until(assertionWaitForTitle("text")); 
}

private Callable<Boolean> assertionWaitForTitle(String start) {
     return () -> Selenide.title().toLowerCase().startsWith(start);
}