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">