1

Currently Jenkins is able to run This test using Maven and Testng. I Want to make a Drop Down list in Jenkins Which will have: For example:

 Platform: - MAC / - Win / - Android / - IOS.
Users: -user1@gmail / -user2@gmail - user3@gmail.

And if i will choose from drop down Android and User3 it will start the test with this set up. Is it possible to implement this way? Because currently in order to change test i need to enter XML file and overwrite the configurations, then push them, and then run.

<test name="Chrome test 1">
    <parameters>
        <parameter name="platform" value="MAC" />
        <parameter name="browser" value="chrome" />
        <parameter name="version" value="56.0" />
        <parameter name="userEmail" value="123456@gmail.com" />
        <parameter name="password" value="123123Test" />
        <parameter name="url" value="https://dev2.com" />
    </parameters>
    <classes>
        <class name="test1"/>
    </classes>
</test>

<test name="Chrome test 2">
    <parameters>
        <parameter name="platform" value="MAC" />
        <parameter name="browser" value="chrome" />
        <parameter name="version" value="56.0" />
        <parameter name="userEmail" value="123123@gmail.com" />
        <parameter name="password" value="123123Test" />
        <parameter name="url" value="https://dev1.com" />
    </parameters>
    <classes>
        <class name="test2"/>
    </classes>
</test>

Anton
  • 1,344
  • 3
  • 15
  • 32

1 Answers1

1

I would propose a slightly different solution.
Since your tests will be run on Jenkins, you can go for Parametrized Build.
It is a plug-in that allows for building with parameters.
You can also choose them from a drop-down. I think you would need a choice parameter to choose from a drop-down. You can access such parameters with Maven (no need for TestNG here).

Community
  • 1
  • 1
Grzegorz Górkiewicz
  • 4,496
  • 4
  • 22
  • 38
  • Maven has a parameter to override the choice of `testng.xml` file, that it can retrieve via such a parameterized build. – Lew Bloch Apr 28 '17 at 21:07
  • 1
    @LewBloch, to wrap up. The OP can: choose to override a TestNG parameter with Maven... or go for only a Maven parameter (without TestNG parameters). – Grzegorz Górkiewicz Apr 28 '17 at 21:13