这是我在selenium 中的第一个测试用例的屏幕截图
请帮我解决这个问题,因为我是硒的新手,所以有什么错误
尝试使用类似的东西:
WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[contains(text(),'COMPOSE')]")));
// click on the compose button as soon as the "compose" button is visible
driver.findElement(By.xpath("//div[contains(text(),'COMPOSE')]")).click();
}
来源:https://www.browserstack.com/guide/wait-commands-in-selenium-webdriver
您的错误是由于尝试单击网络驱动程序找不到的内容而导致的,给它时间加载网页会有所帮助。