testng-dataprovider

TestNG Parallel execution with selenium

我怕爱的太早我们不能终老 提交于 2019-12-02 02:55:40
If i need to run same one method with two different browser at the same time then how will i implement it? For example: public class AppTest2{ @parameters("browser") @Test(dataProvider="loginData") public void login(String userName , String password, String param){ if(param.equals("firefox"){ //do something } if(param.equals("chrome"){ //do something else } } } in my testng.xml file contains: <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name ="My sutie" parallel = "methods", thread-count="5"> <parameter name="browser" value="firefox"/> <test name ="My Test1"> <classes>

How to override the index.html report in testNG

被刻印的时光 ゝ 提交于 2019-12-02 02:34:55
I have a scenario where I need to add some custom messages into index.html testNG report. Is there any way to do that? I just created a custom annotation which I want to publish into index.html testNG report like DataProvider did. I have been tried the below code so far. The below class will create annotation: @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.METHOD }) public @interface Greet { /** * @return - The name of the person to greet. */ String name() default ""; } I just googled but didn't get any idea about that how dataprovider publish the test data into default TestNG

Running same tests against a large number of websites

女生的网名这么多〃 提交于 2019-12-01 12:15:25
I have a need to run the same tests against over 70 websites which are all functionally the same but have different skins. They are all accessed through different URLs however. Using TestNG and Java, What would be an efficient way to pass the URLs to the tests so that I can: a) run each test against each site and report on same b) execute tests in parallel to save time (future need) I want to store the URLs in a format such that it is exposed to end users and configurable by them. This would ideally be in a .csv or alternatively, as in the testng.xml file. I am thinking either @DataProvider or

Running same tests against a large number of websites

馋奶兔 提交于 2019-12-01 09:57:53
问题 I have a need to run the same tests against over 70 websites which are all functionally the same but have different skins. They are all accessed through different URLs however. Using TestNG and Java, What would be an efficient way to pass the URLs to the tests so that I can: a) run each test against each site and report on same b) execute tests in parallel to save time (future need) I want to store the URLs in a format such that it is exposed to end users and configurable by them. This would

How Dataprovider publish the test data into HTML report

[亡魂溺海] 提交于 2019-11-28 02:28:05
I just googled but didn't get any idea about that how dataprovider publish the test data into default TestNG report. If anybody expert about the internal logic of dataprovider please let me know. It would be appreciate if there is any document to understand this better. I just created a custom annotation which I want to publish into default testNG HTML report like DataProvider did. I have been tried the below code so far. The below class will create annotation: @Retention(RetentionPolicy.RUNTIME) @Target({ ElementType.METHOD }) public @interface Greet { /** * @return - The name of the person