Hãy cho biết code này vì sao compile error.
WebElement element = driver.findElement(By.id("UserName"));
bool status = element.isDisplayed();
//Hoặc có thể viết
bool staus = driver.findElement(By.id("UserName")).isDisplayed();Bạn hãy comment câu trả lời của bạn. Nếu chưa có câu trả lời, hãy xem solution.
Solution ở page 2
Không có Data type = bool -> sửa thành boolean.
WebElement element = driver.findElement(By.id("UserName")); boolean status = element.isDisplayed(); //Hoặc có thể viết boolean status = driver.findElement(By.id("UserName")).isDisplayed();chính xác 😀