屏幕截图显示终止按钮仍为红色:
package seleniumProjectTutorial;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class SeleniumWebDriver {
WebDriver driver;
public void invokeBrowser() {
try {
System.setProperty("webdriver.chrome.driver",
"D:\\Selenium\\Drivers\\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().deleteAllCookies();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.get("https://www.google.com");
driver.close();
driver.quit();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args) {
SeleniumWebDriver myobject = new SeleniumWebDriver();
myobject.invokeBrowser();
}
}