Ranorex

Control problems

 
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet
View previous topic :: View next topic  
Author Message
tschi2001



Joined: 15 Feb 2008
Posts: 5

PostPosted: Fri Feb 15, 2008 12:00 pm    Post subject: Control problems
Hello Experts,

I’m new with renorex and want to evaluate it. At first of all I would like to say that it’s a very cool tool!
I downloaded the last release and try the sample .Net Testing -> Samples -> Visual Studio1. There is an example which works with calc.exe. After red that I build my own WindowsApplication with 3 Controls.
After the follow conditional statement the form contains all controls of the calc.exe application.
“form = Application.FindFormClassName("SciCalc", 1, true, 5000)”
Tried the same with my own application and own class name my form contains no controls.

Have someone any ideas?

Best regards,
Tim


Last edited by tschi2001 on Tue Feb 19, 2008 5:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
tschi2001



Joined: 15 Feb 2008
Posts: 5

PostPosted: Fri Feb 15, 2008 12:14 pm    Post subject:
After Debugging I recognized that my form didn’t contain any information from the base node.
For your Information: the class name of my application I get through the RanorexSpy application
Back to top
View user's profile Send private message
Support Team
Site Admin


Joined: 07 Jul 2006
Posts: 256

PostPosted: Fri Feb 15, 2008 2:33 pm    Post subject:
Are you using .NET / Windows Forms for your Application?
If so, your application probably has

"WindowsForms10.Window.8.app.0.b7ab7b"

as class name. This is not unique and other applications can have the same
class name.

So probably your problem is that you find another (invisible) form which has no controls.

If possible, you should search by title. If this is not possible for some reason, you can collect multiple instances (using the FindFormClassName() instance overload) and try to retrieve the Name property to check if it is really your application.

The Spy displays the instance number along with the class name:
WindowsForms10.Window.8.app.0.b7ab7b #2

Note that the instance number is likely to change when restarting the application, as it depends on which applications you have running;
We recommend not to use instances for Forms if possible.

Michael
Ranorex Support Team
Back to top
View user's profile Send private message Visit poster's website
tschi2001



Joined: 15 Feb 2008
Posts: 5

PostPosted: Mon Feb 18, 2008 9:14 am    Post subject:
Hello,

Yes I use .Net.
After used your class name and thread.sleep function my application going well.
My code looks like this:

Application.Start("WindowsApplicationGUITest.exe");
Thread.Sleep(5000);
form = Application.FindFormClassName("WindowsForms10.Window.8.app.0.b7ab7b");

If I didn’t use the sleep function, my code was faster as the started .exe application and the form variable get a null value.

Thanks a lot!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ranorex Forum Index -> RanorexNet All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum