selenium - Is there a way to preserve the order of tests in TestNG without a TestSuite.xml file? -


i'm doing selenium tests in testng. not have maintenance annoyance of keeping of test methods in separate file , rather include package scan @tests.

given scenario, there way preserve order of test methods within test file , have testng consume 1 test class @ time. currently, maintaining method order within tests @test(dependson={}) works; however, i'm seeing situation

testclassa

  • test_method_1
  • test_method_2
  • test_method_3
  • test_method_4

testclassb

  • test_method_1
  • test_method_2
  • test_method_3
  • test_method_4

run tests , order like:

  • classb, method 1
  • classa, method 1
  • classb, method 2
  • classb, method 3
  • classa, method 2
  • classa, method 3
  • classb, method 4
  • classa, method 4

i don't care class order, care methods of 1 test class run entirely before moving on next test class.

anyone?

it great see testng.xml file. seems similar situation described here: http://testng.org/doc/documentation-main.html#testng-xml. think in case should have

<class name="testclassa">   <methods>     <include name="test_method_1" />     <include name="test_method_2" />     ...   </methods> </class>  <class name="testclassb">   <methods>     <include name="test_method_1" />     <include name="test_method_2" />     ...   </methods> 


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -