Page 1 of 1

visible button cannot be found

Posted: Thu Jan 13, 2011 12:59 pm
by CreeTar
My problem is that in our software we have 2 buttons, both have the same caption and one is enabled and one is not. Since it's a MSI-Installer it's not recommended to use control-IDs and I also do not like to use instances, because I found they vary as well.

Thats why I tried this path:

Code: Select all

	
button[@text='I accept >' and @visible='true' and @enabled='true'
to distinguish the button.

But then I receive this error:
WARN User Item 'FRM_Installation.EULA_Dialog.BTN_Accept' could be found using its absolute path, but not by using the repository structure.Please make sure that all of its parent folders have unique paths.
ERROR User Ranorex.ElementNotFoundException: Failed to find item 'FRM_Installation.EULA_Dialog.BTN_Accept' within the specified timeout of 250ms. ---> Ranorex.ElementNotFoundException: No element found for path 'button[@text='Ich akzeptiere >' and @visible='true' and @enabled='true']' within 250ms.

After the execution stops, if i chose to highlight the button, it totally works just fine. It can fine the button for highlighting, but it cannot find the button for clicking?
The error message is also not very helpful, because the path exists and it is unique!

does this even work, using @enabled='true'?

Re: visible button cannot be found

Posted: Thu Jan 13, 2011 1:37 pm
by Support Team
Hi,

Yes the @enabled property should work as expected. If you use Windows 7 or Windows Vista please try to disable the UAC. We had a similar issue with another customer and the issue was solved after disabling the UAC. It seems to be a security problem with some installers.

Would it be also possible to send us a Ranorex Snapshot of the entire application?
Please one if it works and one if it fails.

Thanks in advance.

Regards,
Peter
Ranorex Team

Re: visible button cannot be found

Posted: Thu Jan 13, 2011 2:21 pm
by CreeTar
thanks for the quick reply.
Unfortunately I am using Windows XP.
It fails to find the button, but If i check the repository after the execution stopped, I can highlight
the button and the "Live Element" in properties is filled with the data of the right button.

What type of snapshot do you mean?

Regards

Re: visible button cannot be found

Posted: Thu Jan 13, 2011 3:18 pm
by Support Team
Hi,

Sorry I forgot to copy the link for the description to create a Ranorex Snapshot.
How to create a Ranorex Snapshot:
http://www.ranorex.com/support/user-gui ... html#c2072

Regards,
Peter
Ranorex Team

Re: visible button cannot be found

Posted: Thu Jan 13, 2011 6:25 pm
by CreeTar
I figured out why it won't work.
At first I had the button in a rooted folder (base: empty), which is obviously wrong in the first place.
Then I put it into a normal folder (the one with the white icon) it won't work either,
only if I put it directly in the root folder, the one with Base: /form[@title=... it will find the button.
Though highlighting always works in the yellow, the white and the root folder.

I would prefer to work with those folders to make it easier for me to maintain the repo :(

Re: visible button cannot be found

Posted: Fri Jan 14, 2011 2:05 pm
by Support Team
Hi,

The highlighting works because the absolute path is used to find the item. But if you start the script and the base folder is empty, Ranorex cannot find the base folder and therefore you get an error.

Please also take a look to following links about RxPath and Repository:
http://www.ranorex.com/support/user-gui ... x-spy.html
http://www.ranorex.com/blog/ranorexpath-tips-and-tricks

Regards,
Peter
Ranorex Team