cancel
Showing results for 
Search instead for 
Did you mean: 

ReadyAPI - Running a test with configurations

SOLVED
Highlighted
Contributor

ReadyAPI - Running a test with configurations

I have some tests in which I have to manually change one setting in a config file to run the tests. The setting depends on which test we are running. I don't know if this approach to using ReadyAPI itself is good or bad. But, I would like to be able to create test run configurations for any test instead of manually finding that file and editing it each time. Let me explain more with an example.

In programming IDEs like Intellij IDEA/Eclipse, you can run a test with configurations and you can have multiple configurations for a test. Here is a generic example of how we use that feature. Say we have a test for login to Gmail. For that test, we can have one run config with browserName = chrome. Another config could be browserName = all which will run that test in chrome, firefox and safari. So, for my test, I could make a config like mySetting = abc.

Similarly, do we have run configs for ReadyAPI tests? If not, then why?

Keywords - Run configuration, Debug configuration, Test configuration, Run Config, Debug config, Run time configs.


1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Contributor

Re: ReadyAPI - Running a test with configurations,

Hi,

You could use the 'CustomProperties' tab in the Environments UI.  You can then 'pull' those environment level customer properties into any test you are using.

 

As for config in a Groovy script, may you use the Setup Script tab (availability at Project, test Suite, Test Case) layers to pull in the config from your groovy script.

View solution in original post

3 REPLIES 3
Highlighted
Community Leader

Re: ReadyAPI - Running a test with configurations

@rajs2020 :

 

I would suggest you to use global properties in this case. You can set the desired values in global properties and fetch the values from there.

 

Settings -> Preferences -> Global Properties

 

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Contributor

Re: ReadyAPI - Running a test with configurations

Thanks. What if the config is stored in a groovy script and we have to first load the script from project settings, before running any tests?

Highlighted
Contributor

Re: ReadyAPI - Running a test with configurations,

Hi,

You could use the 'CustomProperties' tab in the Environments UI.  You can then 'pull' those environment level customer properties into any test you are using.

 

As for config in a Groovy script, may you use the Setup Script tab (availability at Project, test Suite, Test Case) layers to pull in the config from your groovy script.

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors