testng with beanshell integration

392 views
Skip to first unread message

joshua p

unread,
Sep 4, 2013, 3:39:24 AM9/4/13
to testng-ann...@googlegroups.com
Hi  All,
                       This is my testng.xml file which will call parallel execution say for example....,
 

 <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
Reply all
Reply to author
Forward
0 new messages