Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要更改等待特定 webElements 的超时时间。对于所有其他人来说,默认值非常好。默认超时可以在设置中更改:
timeout.wait.element=10
如何仅更改给定元素的超时?
要在元素上设置特定超时,您可以使用
textField.setWaitTimeout(10);
textField.input("文本");
但是,如果您也有一些等待标准,并且想要在它成为现实后做某事,您可以使用
String text = textField.wait(w -> w.getText(), t -> t.equals("test"), 10);
或 textField.wait(w -> w.getText().equals("test"), 10); 如果你只想等待某事