**Sinppet**
if (os.contains("win")) {
System.out.println("OS: WINDOWS");
System.setProperty("webdriver.chrome.driver", localPath+"chromedriver.exe");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("headless");
return new ChromeDriver(chromeOptions);
} else if (os.contains("mac")) {
System.out.println("OS: MAC");
System.setProperty("webdriver.chrome.driver", localPath+"chromedriver_mac64");
return new ChromeDriver();
}
我面临的错误
org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of element located by By.xpath: //input[@id='user_id'] (tried for 180 second(s) with 500 MILLISECONDS interval)
at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:80)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:232)
at com.adp.marketplace.frwk.selenium.SeleniumFunctions.waitForVisibilityByXpath(SeleniumFunctions.java:510)
at com.adp.marketplace.prm.SSOTestInPRMSteps.The_user_logged_into_PRM_with_valid_cred(SSOTestInPRMSteps.java:28)
at ?.Given the user logged into PRM with valid creds(com/adp/marketplace/prm/SSOTestsInPRM.feature:7)