这是我调用网络驱动程序的代码。
public class WebDriverUtils {
private static final String karyahost = EnvironmentUtils.getProperty("karya.host", "");
private static final String karyaport = EnvironmentUtils.getProperty("karya.port", "");
private static final long timeOut = 15;
public static RemoteWebDriver webDriver = null;
private static WebDriverWait wait = null;
/**
* Close the browser
*/
public static void closeBrowser() throws Exception{
if (webDriver == null) {
return;
}
webDriver.close();
Thread.sleep(4000);
webDriver.quit();
webDriver = null;
}
/***
* Wait for web element
* @param element - element to be search …Run Code Online (Sandbox Code Playgroud)