[testng-dev] issue with testng.xml file

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[testng-dev] issue with testng.xml file

joshuaperumalla
Hi  All,
                       This is my testng.xml file which will call parallel execution say for example...., but here as beanshell script works only on groups and methods and I need to call TestName at run time is their anyaround to the below code... I need to pass only one or 2 test names at run time as i have 10 test tags in testng.xml file...
 
 <suite name="CriticalTests" preserve-order="true" parallel="tests">

                   <test name=1, preserveorder=true>
                      <method-selector>
                       <script language="beanshell">
                         <![CDATA[
                            testName = testngMethod.getXmlTest().getName();
                              print ("testname = " + testName);
                                 <groups> </groups>
                                  <classes> </classes>
                          ]]>       
                     </script>
                    return testName.equals(System.getProperty("whichTestToRun"));  
                  </method-selector>    
                   </test>

<test name=2, preserveorder=true>
                      <method-selector>
                       <script language="beanshell">
                         <![CDATA[
                            testName = testngMethod.getXmlTest().getName();
                              print ("testname = " + testName);
                                 <groups> </groups>
                                  <classes> </classes>
                          ]]>       
                     </script>
                    return testName.equals(System.getProperty("whichTestToRun"));  
                  </method-selector>    
                   </test>

<test name=3, preserveorder=true>
                      <method-selector>
                       <script language="beanshell">
                         <![CDATA[
                            testName = testngMethod.getXmlTest().getName();
                              print ("testname = " + testName);
                                 <groups> </groups>
                                  <classes> </classes>
                          ]]>       
                     </script>
                    return testName.equals(System.getProperty("whichTestToRun"));  
                  </method-selector>    
                   </test>
</suite>

now when i pass the command ---> -DmvnwhichTestToRun=1
it is running the code but nothing is getting executed and saying build success..
can anyone help me on this

Thanks

--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/groups/opt_out.