title: MVN Selenium Testng -- how to pass parameters from command line to testsuite.xml via pom.xml
body: <p>I have a Selenium project that uses Maven+Testng.  I pass certain parameters to a particular profile in pom like so -- </p>
  
  <pre><code>mvn -PprofileName -Dparam1=%p% -Dparam2=%q% -Dparam3=%r% test
  </code></pre>
  
  <p>This profile in turn references a particular xml file like so --</p>
  
  <pre><code>&lt;suiteXmlFiles&gt;
                                    &lt;suiteXmlFile&gt;C:\path\to\xml\file\testsuite.xml&lt;/suiteXmlFile&gt;
  &lt;/suiteXmlFiles&gt;
  </code></pre>
  
  <p>Now, the parameters get passed just fine from the command line to the pom and it even opens the testsuite.xml and runs all the tests in it.  However, this works only if I have the said paramters hardcoded in the testsuite.xml file.  </p>
  
  <p>HOW do I ensure that these parameters get transferred over to the testsuite.xml from the pom?  I've tried something like below, but it doesn't work (i didn't have any high hopes that it would work, but I tried anyway)</p>
  
  <pre><code>&lt;parameter name="param1"  value="$p" /&gt;
  &lt;parameter name="param2"  value="$q" /&gt;
  &lt;parameter name="param3"  value="$r" /&gt;
  </code></pre>
  
  <p>Any help would be greatly appreciated.  Thanks.</p>