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
Selenium testng-@Test注释的最大优先级值是多少_Selenium_Testng - Fatal编程技术网

Selenium testng-@Test注释的最大优先级值是多少

Selenium testng-@Test注释的最大优先级值是多少,selenium,testng,Selenium,Testng,我使用@test注释中的priority=xxx,按照特定的顺序对自动测试进行了排序 对于要测试的最后一个类,优先级值从10201及以上开始。然而,这个特殊的类是在第一个类之后测试的,优先级为1-10 有人知道吗?我查看了TestNG文档,但是没有讨论这些值。我查看了TestNG源代码,看起来优先级是int,所以最大值是2147483647 事实上,您可以通过运行以下测试轻松地对其进行测试: import org.testng.annotations.Test; public class Tes

我使用@test注释中的priority=xxx,按照特定的顺序对自动测试进行了排序

对于要测试的最后一个类,优先级值从10201及以上开始。然而,这个特殊的类是在第一个类之后测试的,优先级为1-10


有人知道吗?我查看了TestNG文档,但是没有讨论这些值。

我查看了TestNG源代码,看起来优先级是int,所以最大值是2147483647

事实上,您可以通过运行以下测试轻松地对其进行测试:

import org.testng.annotations.Test;
public class Testing {

    @Test(priority = 2147483647)
    public void testOne() {
        System.out.println("Test One");
    }

    @Test(priority = 1)
    public void testTwo() {
        System.out.println("Test Two");
    }
}

谢谢你的快速回复。在这种情况下,为什么在第一个测试类之后执行最后一个测试类。根据优先级值,它应该在序列中最后执行。您是如何执行测试的?你们有测试套件吗?再次谢谢。您的示例显示了一个测试类中的优先级,但正如我在问题中提到的,我的优先级分布在多个测试类中。测试类的集合在testNG xml文件的测试套件中指定。希望这能有所帮助。最好的方法是创建另一个问题并将您的测试套件文件发布到那个里。请记住,优先级较低的测试将首先执行。