Page 1 of 1

Same repository for different Base path urls

Posted: Fri Jun 06, 2014 10:24 am
by wkam2014
Hello,

I need to test my Web Automation on different machines/ deployments.

The application to test will stay the same but the Base url will change.
I also do not want to spend much effort to adjust the Test Automation whenever the application base path changes.

For my User Code Modules this is simple.
I just need to define the Base URL in a common variable.

For repository items I have not found a good approach by now.

How can I automatically change the Base Path of the Repository?

Editing the Base Url of Repository items is not a good solution for me.

My first idea was to change the Url in the Init Method by User Code.
In the docu I see its not recommended to change the Base Url of Repository elements.

Thanks for any suggestions

Re: Same repository for different Base path urls

Posted: Tue Jun 10, 2014 1:17 pm
by zero
I don't know, if I understood your problem. Do you want to change the base url or the path?

If so, you can make either of these variable in your repository. Simply create a variable called "myBasePath" in the repository and initialize it in your code module by using something like this:

Code: Select all

repo.myBasePath = "/machine1/myApp"
Read the topic on "Using Variables within the Repository":
http://www.ranorex.com/support/user-gui ... html#c2970

Regards

Re: Same repository for different Base path urls

Posted: Thu Jun 12, 2014 3:20 pm
by wkam2014
Thanks for the hint.
I set the domain attribute of the required Repository item(s) in the Init method of the user code.
I bound the domain attribute to a Ranorex variable which is set to a unique common string in Init.
This works.