What is the exact difference between “Expected Conditions” and “Expected Conditions”, “Expected Conditions” and “Estimated Conditions”,

My apologies in advance, if my question sounds primary, I am very new to QA and Selenium.

What's the difference between:

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

and

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

I looked here , but did not understand.

+5
source share
1 answer

The visibilityOfElmementLocated function checks if an element is present as well as visible. To check visibility, make sure the element has a height and width greater than 0.

The presence ofOfElementLocated simply checks the dom to see if it can find the element regardless of its visibility.

Source: https://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html#visibilityOf-org.openqa.selenium.WebElement-

visibilityOf public static ExpectedCondition visibilityOf (WebElement element) Apparently waiting for verification that the element that is known to be present in the DOM on the page. Visibility means that the item is not only displayed, but also has a height and width greater than 0. Parameters:

+10
source

Source: https://habr.com/ru/post/1234144/


All Articles