Closed
Description
Description
The isDisplayed atom does return incorrect results for elements with css property content-visibility: hidden
set.
Reproducible Code
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
public class Main111 {
public static void main(String[] args) throws Exception {
ChromeDriver cd = new ChromeDriver();
var page = "<div id='a' style='content-visibility: hidden'>A<div id='b'>B</div></div>";
cd.get("data:text/html;charset=utf-8;base64,"
+ Base64.getEncoder().encodeToString(page.getBytes(StandardCharsets.UTF_8)));
if (cd.findElement(By.id("a")).isDisplayed()) {
throw new IllegalStateException("A");
}
if (cd.findElement(By.id("b")).isDisplayed()) {
throw new IllegalStateException("B");
}
}
}