Page 1 of 1

Control problems

Posted: Fri Feb 15, 2008 11:00 am
by tschi2001
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

Posted: Fri Feb 15, 2008 11:14 am
by tschi2001
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

Posted: Fri Feb 15, 2008 1:33 pm
by Support Team
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

Posted: Mon Feb 18, 2008 8:14 am
by tschi2001
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!