/** * * @param driver * @param by * @param seconds 等待多少秒 * @return */ public WebElement waitPageOpen(WebDriver driver,By by,long seconds){ WebDriverWait wait = new WebDriverWait(driver,seconds); WebElement custumMenu= wait.until(ExpectedConditions.visibilityOfElementLocated(by)); return custumMenu; }
WebElement custumMenu=waitPageOpen(driver,By.xpath( "//aside/div/ul/li[2]/div[1]"),30);
//点击客户管理
custumMenu.click();
标签:seconds,selenium,元素,driver,custumMenu,param,WebElement,等待 From: https://www.cnblogs.com/paisen/p/17654817.html