cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy: Changing resource path for diff environments using readyapi 2.6.0

SOLVED
Highlighted
Occasional Contributor

Groovy: Changing resource path for diff environments using readyapi 2.6.0

I have 3 environments, two have different endpoint , but same resource path , ao am using environments for this

But 3rd environemnt has a different endpoint and different resource path.

Please help with some groovy script to update thie resource path based on environment name.

 

I am hoping to add it in events, projectRunListener.beforeRun

1 ACCEPTED SOLUTION

Accepted Solutions
Occasional Contributor

Re: Groovy: Changing resource path for diff environments using readyapi 2.6.0

We have differnet environments, like

www.qa.google.com\abcd\efgh

www.google.com\abcd\efgh\ijkl\mnop

To parametrize this on different environments, we create project custom property and parametrize using that in different environments,

www.google.com\{templateproperty} using the template property in project.

Then we can change using environments, and changing endpoint for different environments,

www.google.comwww.qa.google.com

Got this answer from smartbear support , by emailing support tech. Thanks all for help, creating screenshot of my solution. 

View solution in original post

3 REPLIES 3
Community Manager

Re: Groovy: Changing resource path for diff environments using readyapi 2.6.0

Leaders, can you please help here?

@msiadak@avidCoder@nmrao 

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Community Hero

Re: Groovy: Changing resource path for diff environments using readyapi 2.6.0

Please show the example with screen shot.
Usually it will be same resource path. Wonder how different it is.


Regards,
Rao.
Occasional Contributor

Re: Groovy: Changing resource path for diff environments using readyapi 2.6.0

We have differnet environments, like

www.qa.google.com\abcd\efgh

www.google.com\abcd\efgh\ijkl\mnop

To parametrize this on different environments, we create project custom property and parametrize using that in different environments,

www.google.com\{templateproperty} using the template property in project.

Then we can change using environments, and changing endpoint for different environments,

www.google.comwww.qa.google.com

Got this answer from smartbear support , by emailing support tech. Thanks all for help, creating screenshot of my solution. 

View solution in original post