我正在尝试将Jenkins与Eclipse结合使用,当我在Eclipse上本地运行我的代码时它很成功,但是当我用Jenkins(也在我的机器上)运行它时它给了我这个错误:
Failed tests: testApp(GitProject.gittest.AppTest): connection refused(..)
事情是,使用chromedriver它很好,但当我用geckodriver运行它失败了。我正在运行一个非常简单的代码:
public class AppTest
{
@Test
public void testApp() throws InterruptedException
{
String exePath = "/Users/Shared/Jenkins/Home/geckodriver";
System.setProperty("webdriver.gecko.driver", exePath);
WebDriver driver = new FirefoxDriver();
System.out.println(driver.manage().window().getSize());
driver.get("https://www.apple.com");
driver.manage().window().setSize(new Dimension(1024, 768));
System.out.println(driver.manage().window().getSize());