1
下面是我的代码,Firefox浏览器不与硒的webdriver代码的build.xml打开
@Before
public void launchApplication() {
System.setProperty("webdriver.firefox.bin", "D:/Program Files/Mozilla Firefox/firefox.exe");
System.err.println("In launch application, before launching firefox");
driver = new FirefoxDriver();
driver.get(testURL);
driver.manage().timeouts().implicitlyWait(300, TimeUnit.SECONDS);
}
当执行上面的代码中使用的junit测试,应用(testURL)被成功地打开和我的测试成功运行。
但是,如果使用build.xml(ant xml)启动它,firefox不会启动,并且在控制台中,我只能看到此消息“在启动应用程序中,启动firefox之前”。之后什么都没有发生。
在这帮助我。
谢谢。