我想根据测试用例ID而不是测试用例摘要执行测试用例

时间:2019-06-24 08:24:29

标签: java selenium jenkins jira-zephyr

我已经将Selenium代码与jenkins集成在一起,以执行以下步骤的测试用例:

https://wiki.jenkins.io/display/JENKINS/Zephyr+For+Jira+Test+Management+Plugin

现在,我必须根据项目结构来叙述我的测试用例。示例:PackageName.ClassName.MethodName,这不是正确的方法。

请告知我是否还有其他方法可以使用Test ID识别测试用例

public class AppTest {

    public static WebDriver driver;
    public static String path = System.getProperty("user.dir");

    @BeforeSuite
    public void setUp() {
        System.setProperty("webdriver.chrome.driver", path + "\\Utilities_files\\chromedriver.exe");
        driver = new ChromeDriver();
        System.out.println(driver);
        driver.manage().window().maximize();
    }

    @Test
    public void testApp() {
        try {
            driver.get("");
            driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Test
    public void testApp1() {
        driver.findElement(By.xpath("aaa")).click();
    }

    @AfterSuite
    public void tear() {
        driver.quit();

    }
}

1 个答案:

答案 0 :(得分:0)

不确定您的意思。但是,如果您尝试使用test ng,则可以继续从testng.xml运行测试用例,而不是直接运行类。您可以在其中指定ID为每个测试用例(场景)唯一的测试用例。如果您需要更多有关testng.xml创建和使用的信息,请点击以下链接。

tesng xml link

相关问题