????????????????????м????????????????google??Firefox??ie?????????????.
???????г???Firefox???????????治????????????ie?????????????
????chromedriver.exe;
????IEDriverServer.exe
????chrome????:
File file = new File("C:/Selenium/chromeDriver.exe");
System.setProperty("webdriver.chrome.driver"?? file.getAbsolutePath());
driver = new ChromeDriver();
baseUrl = "http://www.cnblogs.com/";
driver.manage().timeouts().implicitlyWait(30?? TimeUnit.SECONDS);
driver.get(baseUrl + "/garfieldcgf/");
driver.findElement(
By.id("homepage1_HomePageDays_DaysList_ctl00_DayList_TitleUrl_0"))
.click();
????ie????:
DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
caps.setCapability(
InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS??
true);
File file = new File("C:/Selenium/IEDriverServer.exe");
System.setProperty("webdriver.ie.driver"?? file.getAbsolutePath());
driver = new InternetExplorerDriver();
baseUrl = "http://www.cnblogs.com/";
driver.manage().timeouts().implicitlyWait(30?? TimeUnit.SECONDS);
driver.get(baseUrl + "/garfieldcgf/");
driver.findElement(
By.id("homepage1_HomePageDays_DaysList_ctl00_DayList_TitleUrl_0"))
.click();
????Firefox????:
driver = new FirefoxDriver();
baseUrl = "http://www.cnblogs.com/";
driver.manage().timeouts().implicitlyWait(30?? TimeUnit.SECONDS);
driver.get(baseUrl + "/garfieldcgf/");
driver.findElement(
By.id("homepage1_HomePageDays_DaysList_ctl00_DayList_TitleUrl_0"))
.click();