Same repository for different Base path urls

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
wkam2014
Posts: 4
Joined: Fri Jun 06, 2014 9:34 am

Same repository for different Base path urls

Post by wkam2014 » Fri Jun 06, 2014 10:24 am

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

zero
Posts: 22
Joined: Thu Jan 16, 2014 3:43 pm

Re: Same repository for different Base path urls

Post by zero » Tue Jun 10, 2014 1:17 pm

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

wkam2014
Posts: 4
Joined: Fri Jun 06, 2014 9:34 am

Re: Same repository for different Base path urls

Post by wkam2014 » Thu Jun 12, 2014 3:20 pm

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.