Forum Discussion
- Nastya_KhovrinaSmartBear Alumni (Retired)
Hi Poovaraj,
Currently, QAC will create and run the following command line based on the provided info:
java -cp "C:\TestNG_WORKSPACE" org.testng.TestNG <Your Custom Args>
To specify the class to run you can use the -testclass parameter.
In your case, you may need to specify something like this:
-testclass com.classname.class -testId 1234 -resultPath "\\results" -status Passed -no No
So, if you specify the following in the Automation configuration: https://www.screencast.com/t/GFspEv0b9c, you will receive the following command line:
java -cp "C:\TestNG_WORKSPACE" org.testng.TestNG -testclass com.smartbear.class -testId 1234 -resultPath "\\results" -status Passed -no No
You can find the created command line in the Test Agent logs (How to collect Test Agent logs?) and can compare it with the command line which you use when you run your tests manually.
- raja2Contributor
Thanks for your reply !
- raja2Contributor
How to pass arguments to Maven Project Java file through QA Complete Custom Args text box?
I have developed selenium script using java language without TestNG and have mapped java file to Maven project. I am passing some arguments from QA Complete Custom Args text box to Maven project Java file ? Could you please help me how to pass arguments to Maven Project java file from QA Complete Custom Args text box ? Please find the attached screenshot.
Java file : TestRunner
Java file configured in Maven Project
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>TestRunner</mainClass>
<classpathScope>test</classpathScope>
</configuration>
</execution>
</executions>
Related Content
- 6 years ago
- 11 years ago