Running same tests against a large number of websites

女生的网名这么多〃 提交于 2019-12-01 12:15:25

You can use the @Factory annotation on the constructor for test class EndToEndTest and give it a dataprovider.

private String url;

@Factory(dataProvider = "urls", dataProviderClass = URLProvider.class)
public EndToEndTest(String url) {
  this.url = url;
}

You need to provide the implementation of the URL data provider class to access the excel or whatever file you want and return an Object[][].

Need to modify the constructors of HomePage and SeleniumBase to pass in the url which you are calling from your @BeforeClass method.

This should create a separate instance for this test class for every url string and call the @Test methods.

If you need to pass in more data than a string URL you can use an object instead. As I can see your passing 4 parameters in your testng.xml for a method.

Parallelism should be pretty simple, guessing you would want to run all the @Test methods for a given url in a single thread. The parallel option would be "classes".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!