java - Intersection of groups on testng.xml -


hi i'm trying make groups intersection inside testng.xml when run maven command have nullpointerexception.

here suite:

<test name="test">     <method-selectors>         <method-selector>             <script language="beanshell"><![cdata[             runtest = false;             groupin = system.getproperty("includegroups");             groupnotin = system.getproperty("excludegroups");              if ((groupin == null) || (groupin == "")) {                 runtest = false;             } else {                 stringtokenizer groupstaglist = new stringtokenizer(groupin, ",");                 runtest = true;                  while (groupstaglist.hasmoretokens()) {                   if (!(groups.containskey(groupstaglist.nexttoken())))                     runtest = false;                 }                  if (runtest && (groupnotin != null) && (groupnotin != "")) {                     stringtokenizer groupsnotinlist = new stringtokenizer(groupnotin, ",");                      while (groupsnotinlist.hasmoretokens()) {                        if ((groups.containskey(groupsnotinlist.nexttoken())))                          runtest = false;                     }                  }             }             return runtest;             ]]>             </script>         </method-selector>     </method-selectors>     <packages>         <package name="tests.*"></package>     </packages> </test> 

the output:

error in execution: java.lang.nullpointerexception tests run: 0, failures: 0, errors: 0, skipped: 0, time elapsed: 3.402 sec - in testsuite 

command:

 mvn -dselenium_is_local=true -dbrowser=firefox -dhub=http://127.0.0.1:4444/wd/hub clean test -dincludegroups=groupa,groupb 


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -