Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium TestNg.xml文件未按类顺序运行_Selenium_Testing_Selenium Webdriver - Fatal编程技术网

Selenium TestNg.xml文件未按类顺序运行

Selenium TestNg.xml文件未按类顺序运行,selenium,testing,selenium-webdriver,Selenium,Testing,Selenium Webdriver,TestNg.xml文件未按类顺序运行 所有测试用例并行运行 这样 test1 from MyTests1 class test3 from MyTests2 class test2 from MyTests1 class test4 from MyTests2 class On My 1st Class I have 13 test cases On My 2st Class I have 5 test cases On My 3st Class I have 3 test cases

TestNg.xml文件未按类顺序运行

所有测试用例并行运行

这样

test1 from MyTests1 class
test3 from MyTests2 class
test2 from MyTests1 class
test4 from MyTests2 class


On My 1st Class I have 13 test cases
On My 2st Class I have 5 test cases
On My 3st Class I have 3 test cases

因此,假设顺序是前13个,然后是5个,最后3个,但所有测试都并行运行

尝试设置每个测试的优先级,您将看到它是按顺序运行的
@Test(priority=1)
#Pratik我已经为所有测试用例定义了@Test(priority=1),但它仍然并行运行。当我单独运行类时,它工作正常,但当我运行所有类时,我遇到了问题try setting group=“”和dependsongroup=“”有优先权。实际上我所有的测试用例都是独立的,所以dependsongroup不适用于我。我的意思是,正如你所说,你的第一个类有13个测试用例,你可以将所有这些添加到一个组中,然后你的第二个是一个组,它是dependsongroup第一个类。这并不意味着它们是连接在一起的,这只是在特定流中执行的方式。