vendredi 17 mars 2017

How can I paramaterize my selenium tests to run through multiple scenarios using saucelabs

I have a selenium automation framework which uses junit to run tests locally on a browser of my choice. I currently use junitparams to parameterize some of my tests. e.g

@RunWith(JUnitParamsRunner.class)
public class loginPage extends BaseTestClass{
   @Test
   @FileParameters(value = "src/test/resources/Test data/login.csv", mapper = CsvWithHeaderMapper.class)
   public void login(String username, String pwd) throws Exception{
   }
}

There are tests I have for logging into a website and I use junitparams with a csv file to run through multiple different login scenarios. I am now looking to start using saucelabs to run my tests across multiple different browser/os combinations simultaneously. My question is how do I achieve both the saucelabs parallel tests and parametrized tests at the same time? I have seen examples for saucelabs like the following: http://ift.tt/29wzQ5f

But the issue I will run into is that I cannot use multiple different runners. I need to use a single runner as the Junit @RunWith annotatation requires. Is there an easy way to combine both the ConcurrentParameterized.class runner used in the saucelabs example and the JUnitParamsRunner.class I am currently utilising for local execution?

Aucun commentaire:

Enregistrer un commentaire