Question re changes in a web application

Ask general questions here.
Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Question re changes in a web application

Post by Fergal » Thu Apr 10, 2014 10:45 am

Ranorex Studio 5.0.1.17706

I have a suite of 50 tests for a web application. The application includes a menu of folders with items included in the folders. It looks something like the following;

Folder 1
  • Folder 1 - item 1
  • Folder 1 - item 2

Folder 2
  • Folder 2 - item 1
  • Folder 2 - item 2
  • Folder 2 - item 3
Most of my tests are run on Folder 2 and run successfully. However, when I add items to Folder 1 it pushes Folder 2 further down the web page and then the tests for Folder 2 fail. The tests that fail are tests such as to add an item to Folder 2 and they fail because Ranorex can't find the location to add the item. Is there any way for me to fix those tests, without re-recording them?

Thanks!

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

Re: Question re changes in a web application

Post by krstcs » Thu Apr 10, 2014 1:55 pm

Can you provide a snapshot of your application under test?

Can you provide a copy of a sample solution showing the issue?

My guess would be that it is an object identification issue. There may be something in the paths of the objects that is no longer valid when a new object is added, such as using an index, etc.
Shortcuts usually aren't...

Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: Question re changes in a web application

Post by Fergal » Fri Apr 11, 2014 10:05 am

Thanks for your reply krstcs. The application has not been released yet. When my Ranorex tests are adding items to the application, it searches for buttons and menu items via location, but can no longer find those button or menu items, because their location on the screen has changed. Please see an example below, of a test step that is failing.

Image

Is it possible for me to change the location properties, so that the test looks for the item somewhere else, or even looks for it anywhere on the page?

Thanks!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Question re changes in a web application

Post by Support Team » Mon Apr 14, 2014 3:09 pm

Hello Fergal,

Ranorex is searching for the element on the entire screen. The location you mentioned is the location of the click action in relation to the clicked element. Therefore it seems like your issue isn't related to the position of the element but to a wrong index or something similar. It's hard to analyze and resolve your issue without additional information. May I ask you to send a sample solution as well as the already mentioned Ranorex snapshot to [email protected].

Regards,
Robert
.
Image

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Question re changes in a web application

Post by mzperix » Tue Apr 15, 2014 7:37 am

Hi Fergal,

Try to check the element's xpath in SPY. When you drag and drop, the hierarchy of the elements are changing. If your xpath contains this heirarchy, then after the first move the script will inevitably fail, since the xpath is not reflecting the cahnge.

A solution is usually to change the xpath so the element will always be found.

Could you show us the xpath of the element you showed us in your screenshot?

Best Regards,
Zoltán Major

Fergal
Certified Professional
Certified Professional
Posts: 298
Joined: Tue Feb 18, 2014 2:14 pm
Location: Co Louth, Ireland
Contact:

Re: Question re changes in a web application

Post by Fergal » Wed Apr 16, 2014 12:09 pm

Thanks Zoltán, I need to learn more about xpath and Spy.

Thanks also Robert, I have sent an email to support.