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之前」。之後什麼都沒有發生。
在這幫助我。
謝謝。