selenium测试问题-简单
想研究下selenium2.0怎么用,从网上找了些代码,但是运行时出现了问题,请问谁知道解决办法,或者有简单的测试工程打包给我发一个,我练练手,谢谢。我的邮箱 seabird_2000@163.com
目前遇到的问题是,执行到WebDriver driver = new FirefoxDriver()就停住了,火狐弹出来了,也没有马上报错。但是没有继续往下执行,也没有输出2,System.out.println("2");
package com.selenium;
import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.WebDriver.Navigation;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.support.ui.Select;
public class TestHello {
WebDriver driver;
@Test
public void helloWorld() throws Exception {
System.out.println("start firefox browser...");
System.setProperty("webdriver.firefox.bin", "D:/Program Files (x86)/Mozilla Firefox/firefox.exe");
System.out.println("1");
WebDriver driver = new FirefoxDriver();
System.out.println("2");
Navigation navigation = driver.navigate();
System.out.println("3");
navigation.to("http://www.baidu.com/");
System.out.println("start firefox browser succeed...");
}
}