【问题标题】:what is the exact difference between "ExpectedConditions.visibilityOfElementLocated" and "element.isDisplayed()"“ExpectedConditions.visibilityOfElementLocated”和“element.isDisplayed()”之间的确切区别是什么
【发布时间】:2016-01-19 13:58:49
【问题描述】:

如果我的问题听起来很重要,我提前道歉,我是 QA 和 Selenium 的新手。

两者之间的确切区别是什么:

 wait.until(ExpectedConditions.visibilityOfElementLocated
                    (By.xpath("//a[text()='Show advanced settings...']"))).click();

 element.isDisplayed();

我相信当第二个返回 true 时,我们可以点击 web 元素,但我不确定第一个,我读过它here 但还不确定。

【问题讨论】:

标签: java selenium selenium-webdriver selenium-chromedriver


【解决方案1】:

您的第一个是等待,并且会一直等到该条件为真。

第二个根据元素是否显示返回真或假。

阅读您的另一个问题和这个问题,您可能会更容易写出您想要做的事情,因此我们可以帮助您。

What is the exact difference between "ExpectedConditions.visibilityOfElementLocated" and "ExpectedConditions.presenceOfElementLocated"

谢谢

【讨论】:

    猜你喜欢
    • 2016-01-19
    • 2021-05-19
    • 2013-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多