Page 1 of 1
Debugging in Visual Studio
Posted: Sat Oct 03, 2009 11:50 am
by atom
Hiya
We have some problems while debugging in visual studio
If you set a breakpoint, and then start stepping through the code, all Ranorex statements fail
because VS is On Top and not the AUT.
It seems such a simple problem, but I cant think of how to get around it (other than having two monitors!)
Is there a way to get Visual to minimise when you debug, so the AUT can be seen ?
Thanks
Clayton
Re: Debugging in Visual Studio
Posted: Mon Oct 05, 2009 4:33 pm
by Support Team
If you use Ranorex adapters and set the
Adapter.DefaultUseEnsureVisible property to
true, Ranorex will automatically try to bring the corresponding UI to the foreground (e.g. when you invoke
Adapter.Click or
Adapter.MoveTo). This is not true if you work directly with
Element objects:
Button button = "pathToMyButton";
// if you step through this code, Ranorex tries to bring the button to the foreground
button.Click();
// if you work directly with Element instances, Ranorex won't call EnsureVisible
Element buttonElement = button.Element;
buttonElement.Click(); // fails if you step through with debugger
Regards,
Alex
Ranorex Support Team
Re: Debugging in Visual Studio
Posted: Mon Oct 05, 2009 6:06 pm
by atom
Ok, so
Adapter.DefaultUseEnsureVisible is applied globally
But a the instance property is used only for an adapter instance?
Re: Debugging in Visual Studio
Posted: Mon Oct 05, 2009 6:25 pm
by Support Team
The value of Adapter.DefaultUseEnsureVisible is applied for instances that have the Adapter.UseEnsureVisible property set to null. I.e. for every instance set Adapter.UseEnsureVisible to true or false to tell Ranorex to use EnsureVisible or not, respectively, or set it to null to use the value of DefaultUseEnsureVisible.
Regards,
Alex
Ranorex Support Team