UI Items not detected

Ask general questions here.
KenLee
Posts: 10
Joined: Wed May 09, 2012 10:40 pm

UI Items not detected

Post by KenLee » Tue Jul 24, 2012 8:01 pm

Ranorex will randomly not able to detect a UI item. I have no idea what causes it. My test cases may work today but maybe not tomorrow. I've let my colleague try the same test cases and his ranorex could detect the UI item(text box), but not on my computer. I've tried playing with the delay timer as suggested in another thread, but it still didn't not help me.

Any ideas?

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: UI Items not detected

Post by Ciege » Tue Jul 24, 2012 9:26 pm

Sounds like timing...
What kind of AUT is it?
Can you share a snippet of code that works sometimes but fails at other times?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

KenLee
Posts: 10
Joined: Wed May 09, 2012 10:40 pm

Re: UI Items not detected

Post by KenLee » Thu Jul 26, 2012 11:19 pm

This is my respository. I high light this element and click the "High light selected respository item", the item I am looking for will be high lighted in green like the following image. The high lighted element is just a regular text box. It looks empty because I erased whats inside.
Ranorex Repository.JPG
However, when I run ranorex, it will not detect the element in runtime and it will return this error msg to me.
Ranorex Error.JPG
This is the the simple code that I used. This code will work in my partner's computer and it will work for me sometimes. I don't know what the condition is for mine to fail and his to work all the time. The commented out code is just to test.
Ranorex Code.JPG
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: UI Items not detected

Post by Support Team » Fri Jul 27, 2012 12:31 pm

Hi,

Have you tried to report all children of Element_tickerTextBox? Is the desired element in the list of the children?

To get a better insight to your problem a snapshot would be nice. (see Creating Ranorex Snapshot Files)

Regards,
Larissa
Ranorex Support Team

KenLee
Posts: 10
Joined: Wed May 09, 2012 10:40 pm

Re: UI Items not detected

Post by KenLee » Fri Jul 27, 2012 6:01 pm

Like I said, my code works on my partner's computer. He also have ranorex code where it does not work on his computer and work on mine. I don't know the reason why, but I would just like to fix it. The behavior of this error is very random and hard to debug because I don't know what is wrong. Also, in some of my test cases it would be able to detect the element, but not in some. For example, FunctionWizard (test case1) will look for that text box and Ranorex would not find it. However, it will be able to find the text box in Currency(test case2).

I added my respository with the spy by clicking "Add to respository(including children)". I think that should've added everything I need.

I have a snapshot of my RXpath like you requested.
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: UI Items not detected

Post by Support Team » Mon Jul 30, 2012 3:14 pm

Hi,

Thank you for the snapshot.
Do your partner and you use the same .Net framework versions and operating systems?
Did you try updating to the latest Ranorex version?
Have you tried to increase the "Search Timeout" by a much larger value (e.g. 5 min)? Since it is an excel list it may take a while to find the right entry.

Regards,
Larissa
Ranorex Support Team

KenLee
Posts: 10
Joined: Wed May 09, 2012 10:40 pm

Re: UI Items not detected

Post by KenLee » Wed Aug 01, 2012 12:43 am

We're using the same framework version and operating systems. Ranorex is also up to date. I've also tried to set my timeout to 3 minutes and nothing happened.

I've figured out a way for my ranorex to work, but you still have to keep in mind that my friend's PC does not need to do this for the same code to work.

My test case always starts an instance of excel and create some products on the spreadsheet and the information of these products will be displayed in some textboxes. Then, my test case would do some validation on these text box, combo box. etc. When it is finished, it will close that instance of excel and repeat similar procedure for another test case. However, Ranorex will usually fail to detect the elements and give me the above errors that I posted.

When I was playing with this problem, I found out ranorex would detect the elements if I let it run until it creates the products and then stop it and re run it (I have to comment out the code to start a new instance of excel before I rerun ranorex). The only difference between my previous method is just that there is an existing excel instance when I activate Ranorex as oppose to letting Ranorex open its own version of Excel.

Does this success have anything to do with how Ranorex reading programs in the cache? I know that Ranorex detect Rxpaths in run time for sure, but why is it not working when there is no existing excel before it runs.

User avatar
artur_gadomski
Posts: 207
Joined: Mon Jul 19, 2010 6:55 am
Location: Copenhagen, Denmark
Contact:

Re: UI Items not detected

Post by artur_gadomski » Wed Aug 01, 2012 9:38 am

Try disabling cashe at excel element in your repository.

KenLee
Posts: 10
Joined: Wed May 09, 2012 10:40 pm

Re: UI Items not detected

Post by KenLee » Wed Aug 01, 2012 4:37 pm

I've tried already tried that, but it didn't help my problem.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: UI Items not detected

Post by Support Team » Thu Aug 02, 2012 3:41 pm

Hi,

In order to help you we would need a Ranorex Snapshot file of the specific Elements shown in your posted screenshot, a snapshot of an empty Excel file is unfortunately not really helpful.
Please also send us your repository and the log file which holds the error message.
If you like you can also send the files to our support email address: [email protected].

Regards,
Markus
Ranorex Support Team