maven+testng传参数

1.jenkins 有cookie参数要传入

 

Run:  clean test -Dcookie=$cookie

 

2.maven接收

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.19.1</version>
    <configuration>
        <systemPropertyVariables>
            <testEnvironment>${cookie}</testEnvironment>
        </systemPropertyVariables>
        <suiteXmlFiles>
            <suiteXmlFile>${xmlFileName}</suiteXmlFile>
        </suiteXmlFiles>
    </configuration>
</plugin>

 

 

3.testng接收

<suite name="AdSDK" thread-count="1">
    <parameter name="cookie" value="${cookie}" />
    <test name="AdSdkTest" preserve-order="true">

 

posted @ 2017-08-14 18:46  q55091  阅读(1147)  评论(0编辑  收藏  举报