selenium - Test method not run with sequence in testng -
i using testng + webdriver automation project order of test execution not working expected have specified order each method below method signature , notation
@test(dependsonmethods="verifyelementsonprofilescreen",alwaysrun = true) public void verifymyselfprofilevisibility(){
testsuit have using :
<?xml version="1.0" encoding="utf-8"?> <!doctype suite system "http://testng.org/testng-1.0.dtd"> <suite name="regressionsuite" parallel="none"> <parameter name="applicationopt" value="web"></parameter> <parameter name="browser" value="firefox"></parameter> <test name="test"> <classes> <!-- login module --> <class name="tests.login.loginapp"/> <method> <include name ="loginuser"></include> </method> <!-- portal module --> <class name="tests.profile.profilemodule"> <method> <include name="verifyelementsonprofilescreen"></include> <include name="verifymyselfprofilevisibility"></include> </method> </class> <class name="tests.profile.participantauditlog"> <method> <include name="verifyauditlogforcreateprofileevent"></include> <include name="verifyauditlogforupdatecontactinfoevnet"></include> <include name="verifyauditlogforupdateprivacydirective"></include> </method> </class> </classes> </test> <!-- test --> </suite> <!-- regressionsuite -->
do mean classes specified in testng.xml file not executing in specified order.. please use preserve-order= "true"
<suite name="mysuite" preserve-order= "true"> <test name="mytest">
if want specify order of methods execution in class use priority
@test( priority = 1 )
group-by-instances="true" useful if face situation execution order of priority methods of different classes not expected..
<suite thread-count="2" verbose="10" name="testsuite" parallel="tests"> <test verbose="2" name="mytestcase" group-by-instances="true">
thank you, murali
Comments
Post a Comment