ranored could not able to find controls in a box

Class library usage, coding and language questions.
sumanth
Posts: 3
Joined: Tue Apr 07, 2009 10:51 am

ranored could not able to find controls in a box

Post by sumanth » Tue Apr 07, 2009 11:04 am

Hi,

i have written a script where i need to set some fields in a box and submit that which will open one more Dialog box where i need to set some more fields and submit. The problem is ranorex could not able to find any controls in secondary Dialog box some times But some times it is.

Any ideas what is getting wrong here


Thanks in advance

Regards
Sumanth

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

Post by Support Team » Tue Apr 07, 2009 5:03 pm

Please, give us some more information:
- which Ranorex version do you use?
- what framework is your application under test based on (Win32, Windows Forms, WPF)?
- what's the exact error message?
- if Ranorex V2.X: what's the path to the element that is not found?

If Ranorex finds the elements only sometimes, that could be a timing issue, but I'm only guessing with the information I currently have.

Regards,
Alex
Ranorex Support Team

sumanth
Posts: 3
Joined: Tue Apr 07, 2009 10:51 am

Post by sumanth » Tue Apr 07, 2009 5:14 pm

Hi,

I am using Ranorex 1.5.1
its win32 framework based
the exact error message was " Ranorex could not able find control with id in the form"

one more thing is the window from which the controls i could not able to get comes in 2 possibilities. these are authentication windows

in first window if i use text fields to pass my credentials, i can able to get control for second window also, where as if in first window i use selectlist to select paritcular field then i am facing this problem


i also tried to find all possible controls using foreach {Control control .....}

which is showing there are no controls if i am using a select field value in first dialog box

Hope i am clear with the explanation

Thanks in advance

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

Post by Ciege » Tue Apr 07, 2009 8:19 pm

When your script fails, does the spy tool show the controls?

Are you verifying the window that has the controls in it exists before you search for the controls?

You mention 2 possible windows can appear. Are you checking which one does appear and based on that information search for the controls that you would expect to appear in that specific window? (If then else statement)

Can you post the snippet of code that shows the submit on the initial window and then where it fails when looking for the controls on the next window?

sumanth
Posts: 3
Joined: Tue Apr 07, 2009 10:51 am

Post by sumanth » Thu Apr 09, 2009 4:47 am

I think I got solution for this problem.

The main issue was there was a hidden window which got the same name as the window on which i am trying to access controls.


Ranorex was activating hidden window instead of the required window which causes the exceptions "control not found".

The solution for this to iterate through the windows which got the name and check which window got the required controls and then access it.

Thanks and Regards
Sumanth