开源 Selenium3.0 自动化测试工具的变化(5)

发表于:2016-10-14来源:虫师作者:虫师点击数: 标签:selenium
package base.test.demo; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.* ; public class BaiduTest { public static void main(String[] args) { We

package base.test.demo;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.*;

public class BaiduTest {
    public static void main(String[] args) {

        WebDriver driver = new FirefoxDriver();
        driver.get("https://www.baidu.com/");
        driver.findElement(By.id("kw")).sendKeys("selenium java");
        driver.findElement(By.id("su")).click();
        driver.quit();
    }

}

 

原文转自:http://www.cnblogs.com/fnng/p/5932224.html

...