I'm facing a little issue with my automated test. Whenever the test encounters an error like this:
Expected condition failed: waiting for visibility of element located by(...)
I find it difficult to pinpoint the exact problem.
@BeforeMethod
public void BeforeTest(){
System.setProperty("webdriver.chrome.driver", "C:/drivers/chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.navigate().to("https://poczta.o2.pl/rejestracja/");
}
@Test
public void Test(){
WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement Category_Body = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("[name='9cb78dee-04b3-01d5-524b-9159a1646cd3']")));
WebElement user = driver.findElement(By.cssSelector("[name='9cb78dee-04b3-01d5-524b-9159a1646cd3']"));
user.sendKeys("Cezary");
WebElement user2 = driver.findElement(By.cssSelector("input[name*='42aced']"));
user2.sendKeys("Znojek");
WebElement male = driver.findElement(By.id("male"));
((WebElement) male).click();
}
Can you help me identify the root cause of the issue?