【问题标题】:Jenkins Build is not stopped after successfully passing the Integration test成功通过集成测试后,Jenkins Build 没有停止
【发布时间】:2013-05-31 07:52:03
【问题描述】:

您好,我是 Jenkins 的新手。

我已经在我的机器上本地配置了 Jenkins,它运行良好。

每当我的集成测试(用 Junit 编写)通过时,我都需要询问,Jenkin 不会停止构建并继续构建。

但在日志中显示测试用例通过,没有发现错误。

有人可以建议任何解决方案如何阻止詹金斯构建吗?

我的代码:

package com.workshop.airport.workshop.airport;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

import cucumber.api.java.After;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.When;

public class PageStepsDefs {

    public String ChromeDriverPath="C:\\Users\\zain.jamshaid\\Desktop\\chromedriver.exe";
    public WebDriver webdriver;
    String localhost="http://www.google.com";



    public PageStepsDefs (){
        System.setProperty("webdriver.chrome.driver",ChromeDriverPath);
        webdriver = new ChromeDriver(); 
    }

    @Given("^I browse to the (.+) page$")
    public void open_page(String url)
    {
        webdriver.get(localhost+url);
        System.out.println(localhost+url);
    }

    @When("^I click on the button (.+)$")
    public void click_On_Menu(String Id)
    {
        webdriver.findElement(By.id(Id)).click();
        System.out.print(Id);
    }

    @After
    public void close_browser(){
        webdriver.close();
    }
}

我还附上了jenkins控制台日志的截图

任何帮助都会很棒。

谢谢!

【问题讨论】:

  • 您是否停止了脚本中启动的所有子进程? Hudson 可能正在等待子进程退出
  • 嗨 Jayan,我相信我已经停止了所有进程,您可以查看我的代码。我已经添加了它。请看一看。

标签: java jenkins hudson jenkins-plugins hudson-plugins


【解决方案1】:

我正在使用 webDriver.close(); 但 webDriver.quit(); 解决我的问题

这解决了问题

【讨论】:

    猜你喜欢
    • 2017-10-17
    • 1970-01-01
    • 2022-06-15
    • 2010-11-02
    • 2016-10-27
    • 2021-01-05
    • 1970-01-01
    • 1970-01-01
    • 2019-01-19
    相关资源
    最近更新 更多