I am executing my selenium automation scripts through testng, for the same I am having a testng xml form where I am passing parameter values like which test case has to be executed and on which environment it has to be executed.
E.g of testng xml is pasted below
**<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Automation Suite">
<parameter name="tags" value="MyTestCase"/>
<!-- Default suite -->
<test name="GGGGG Automation Test" verbose="2">
<parameter name="Environment" value="MyEnvironment" />
<classes>
<class name="com.XXXXX.TestRunner.XXXXXX"/>
</classes>
</test>
</suite>**
here I am passing 2 parameters like test cases and environment to be executed form testng example. I am looking for a command line 'command' to execute the testng xml passing those 2 parameters from commandline argument.
By using JVM arguments you can pass in parameters, such as -Dname=Environment. This has been answered previously here.