Automated test does not work after renaming some forms

Ranorex Studio, Spy, Recorder, and Driver.
Manel
Posts: 1
Joined: Thu Jan 29, 2015 8:14 am

Automated test does not work after renaming some forms

Post by Manel » Thu Jan 29, 2015 8:28 am

Hello,

We're using Ranorex Studio 5.2

We're unable to run our most important automated testing suit after we've changed the name of some of our application forms due a change in our company naming convention in .Net.

The test is failing to locate the controls on the screen, as it seems to be searching for them with the old names.
How can we refactor a name change quickly in the complete test suit? We can't repeat the whole test development just for this!

Thanks for any help,

Best,

Manel.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Automated test does not work after renaming some forms

Post by krstcs » Thu Jan 29, 2015 4:01 pm

All you have to do is change the RanoreXPath in the Repository for each element that changed.

If you aren't using the Repository then you will have to change the paths in your code or wherever you are storing the paths.
Shortcuts usually aren't...

paulhorton
Posts: 6
Joined: Thu Jul 13, 2017 2:18 pm

Re: Automated test does not work after renaming some forms

Post by paulhorton » Mon Jul 31, 2017 11:58 am

Hi
i apologize if i should have created a new post, i have a simular kind of problem, yet different in other ways. I am running Ranorex 7.1.0 and my problem is that i have created a suit to run on a web page example http://www.WebPage-A.com' but also need to run on http://www.WebPage-B.com' as the sites have the same information on but just have a different A or B within the URL...i have coppied WebA and saved as WebB but as the reposatries are looking for WebPageA these wont Run on WebPageB, is there a quick fix so i dont need to edit all repos urls to WebPageB but instead say look for WebpageA or WebpageB

Many Thanks

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Automated test does not work after renaming some forms

Post by krstcs » Mon Jul 31, 2017 2:55 pm

First, yes, you should have created a new post since your situation is a little different, and you are on a different version of Ranorex. In addition, it is considered bad form to respond to very old threads (this one is over two years old).

Second, all you should need to do is variablize your dom in the repo. No need to copy it to a new one. Just make your dom like this:

/dom[@domain=$MyDomVariable and @state='complete']

This will make a variable called "MyDomVariable" (you can change it to something more meaningful) that you can then bind as needed for each domain.
Shortcuts usually aren't...

paulhorton
Posts: 6
Joined: Thu Jul 13, 2017 2:18 pm

Re: Automated test does not work after renaming some forms

Post by paulhorton » Mon Jul 31, 2017 3:22 pm

Hi krstcs

Very sorry and will make sure i dont do this again in the future, just a quick question how do i variablize your dom in the repo please? im still quite new to Ranorex

Many Thanks

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Automated test does not work after renaming some forms

Post by krstcs » Mon Jul 31, 2017 3:48 pm

My previous post showed how to do it.

If you haven't already, you should read the User Guide/Help Center completely. It covers this topic in depth, in addition to many others that will help you greatly!!
Shortcuts usually aren't...

paulhorton
Posts: 6
Joined: Thu Jul 13, 2017 2:18 pm

Re: Automated test does not work after renaming some forms

Post by paulhorton » Tue Aug 01, 2017 10:46 am

Hi krstcs

i have looked through the guide (thank you for that link) and still having a problem

I have created a variable called MyDomVariable and put the default value to /dom[@domain=$MyDomVariable and @state='complete'] then added the variable to the repository folder and ran the automation and still not having any luck :?

This is what is dispalyed in my repos folder URL (see Attached)
Capture1.PNG
You do not have the required permissions to view the files attached to this post.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Automated test does not work after renaming some forms

Post by krstcs » Tue Aug 01, 2017 1:55 pm

What is the default value of the variable? It must be the same as the actual domain you are looking for or it won't find it, because you are using the equals ("=") operator. If you didn't enter a default value for the variable then it will look for a domain that is blank.

The variable is a repo variable, so you will find the definition and default value in the repo's Variables dialog.

Note that this is just the DEFAULT value and if you bind that variable in a test suite then it will change at runtime to whatever the value is of the data source or parameter that it is bound to.
Shortcuts usually aren't...