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
Post a Comment