package ccwp.info.shiyan;
import org.openqa.selenium.WebDriver.Navigation;
import org.openqa.selenium.firefox.FirefoxDriver;
public class shiyan {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
FirefoxDriver driver = new FirefoxDriver();
Navigation navigation =driver.navigate();
navigation.to("http://www.baidu.com");
driver.close();
driver =null;
}
}
import org.openqa.selenium.WebDriver.Navigation;
import org.openqa.selenium.firefox.FirefoxDriver;
public class shiyan {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
FirefoxDriver driver = new FirefoxDriver();
Navigation navigation =driver.navigate();
navigation.to("http://www.baidu.com");
driver.close();
driver =null;
}
}
本文介绍了一个简单的Java程序,该程序使用Selenium的FirefoxDriver来打开火狐浏览器并导航到百度首页。通过这个示例,读者可以了解如何利用Selenium进行基本的网页自动化操作。
4129

被折叠的 条评论
为什么被折叠?



