使用 selenium 等待文本字段时要等待的正确 ExpectedConditions 是什么?

What is the right ExpectedConditions to wait for when waiting for text field using selenium?

目前,每当我想等待任何 Web 元素(文本字段、下拉列表等)时,我都会使用 elementToBeClickable:

wait.until(ExpectedConditions.elementToBeClickable(By.xpath("someXpath")))

但我有时会遇到某个文本字段 Web 元素的问题,我需要输入文本并自动完成,有时它在自动化过程中卡住了,如果我点击它,自动化 returns工作.......太奇怪了。

我认为这可能与 ExpectedConditions 有关..? 有人遇到过这个问题吗?

谢谢

elementToBeClickable 基本上会检查元素 是否可见并启用.

I thought it might have something to do with the ExpectedConditions..? Anyone ever had this issue?

我认为您描述的问题与等待和预期条件无关。

此外,不确定是否相关,但有时您需要单击文本字段,然后再向其发送密钥。而且,有时您需要移动到一个元素,点击然后向其发送密钥。