Is there any way to pass in multiple URL's

42 views
Skip to first unread message

Sathira Padukka

unread,
Oct 2, 2019, 11:51:18 AM10/2/19
to SpecRun
Just wondering if there is anyway I can pass in multiple URL's for example I want to test the same test case on staging and production. Is there anyway I can pass it through the srprofile?

Thank you in advance.

Stephen McCafferty

unread,
Oct 3, 2019, 8:25:31 AM10/3/19
to SpecRun
You could use targets to do this. Define a target for staging and production with an environment variable that contains the URL, similar to in the Selenium sample project. In the case of the Selenium project, the same test is run on multiple browsers, each of which is defined as its own target and with its own environment variable for the browser, as you can see in the profile. You can apply a similar approach to handling the URL.

There is an article here that goes into more detail on how the sample project is set up. It also shows how the environment variable defined in the targets is then used to control the execution of the tests. In the case of the sample project, this is used to return the desired web driver. You could apply a similar approach to returning your URL, i.e. check the environment variable and then set the target URL as required (instead of the web driver).
Reply all
Reply to author
Forward
0 new messages