【问题标题】:How can we run Selenium-java-Maven Test Cases with a proper UI infrastructure我们如何使用适当的 UI 基础架构运行 Selenium-java-Maven 测试用例
【发布时间】:2021-11-10 06:17:29
【问题描述】:

我在一家跨国公司工作,我有一个预先创建的 selenium-maven 框架,我们通过注释取消注释来运行测试用例。 例如。

<class name="abc.def.ghi.testCaseName1"/>
<class name="abc.def.ghi.testCaseName2"/>
<!-- <class name="abc.def.ghi.testCaseName3"/> -->

但是现在我需要更改它的外观和感觉,以便在运行测试用例时我们不必注释和取消注释测试用例,而是通过一些 UI 运行它。有可能吗?

请告诉我一个开源应用程序,我们可以通过它实现它,并且它应该符合 MNC 政策,因此它不需要必要的信息。

【问题讨论】:

标签: java selenium maven selenium-webdriver selenium-chromedriver


【解决方案1】:

如果你不想注释和取消注释xml文件,你需要创建main方法并从那里运行,

public static void main(String args[]){
    String xmlFilesList = args[0];
    String groupName = args[1];
    List<String> suites = new ArrayList<>();
    String[] filenames = xmlFilesList.split(",");
    for(String eachFIlename: filenames){
        String newFilename = "Inputs/Suites/"+eachFIlename+".xml";
        suites.add(newFilename);
    }
    TestNG runner = new TestNG();
    runner.setTestSuites(suites);
    runner.setGroups(groupName);
    runner.run();
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-10
    • 2021-01-16
    • 1970-01-01
    • 2015-08-19
    • 1970-01-01
    • 2012-07-04
    • 1970-01-01
    相关资源
    最近更新 更多