标签:ack 例子 import drive ext oid public out rom
package mavenweb2;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.*;
import org.openqa.selenium.chrome.*;
public class Ruuu {
public static void main(String[] args) {
// System.setProperty("webdriver.firefox.bin", "/Applications/Firefox.app/Contents/MacOS/firefox-bin");//浏览器路径
// System.setProperty("webdriver.gecko.driver","/Users/lucax/Downloads/geckodriver");//浏览器驱动路径
// WebDriver driver = new FirefoxDriver();
WebDriver driver = new ChromeDriver();
driver.get("http://www.baidu.com/");
// WebElement txtbox=driver.findElement(By.id("kw"));
// txtbox.sendKeys("selenium java");
// WebElement btn=driver.findElement(By.id("su"));
// btn.click();
// driver.close();
// System.out.println("end selenium");
driver.findElement(By.id("kw")).sendKeys("selenium java");
}
}
标签:ack 例子 import drive ext oid public out rom
原文地址:https://www.cnblogs.com/kaibindirver/p/11725473.html