[英]How to run an entire test suite with Selenium & JUnit 5 on different URLs
I have a test class that currently uses parameterized tests to run each test on different URLs. 我有一个测试类,当前使用参数化测试在不同的URL上运行每个测试。 However I want the output to be in the form
但是我希望输出形式为
instead of 代替
I can accomplish this by having a seperate class for each URL but there are over 300 URLs so that's not really an option. 我可以通过为每个URL设置单独的类来实现此目的,但是有300多个URL,所以这不是一个真正的选择。 The classes would be the same except for paremters though so:
这些类是相同的,除了paremters一样:
My problem is similar to this: Running same tests against a large number of websites 我的问题与此类似: 对大量网站运行相同的测试
Used the below parameterized test class and got the result. 使用下面的参数化测试类并获得结果。 All tests for a parameter are executed before next parameter is used.
在使用下一个参数之前,将对参数进行所有测试。
@RunWith(Parameterized.class)
public class ParamTest {
@Parameters
public static Object[] data() {
return new Object[] { "google", "yahoo", "facebook" };
}
@Parameter
public String url;
@Test()
public void test1() {
System.out.println("Test 1 - "+url);
}
@Test()
public void test2() {
System.out.println("Test 2 - "+url);
}
}
Test 1 - google
Test 2 - google
Test 1 - yahoo
Test 2 - yahoo
Test 1 - facebook
Test 2 - facebook
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.