Debugging in Visual Studio

Ask general questions here.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Debugging in Visual Studio

Post by atom » Sat Oct 03, 2009 11:50 am

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

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

Re: Debugging in Visual Studio

Post by Support Team » Mon Oct 05, 2009 4:33 pm

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

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: Debugging in Visual Studio

Post by atom » Mon Oct 05, 2009 6:06 pm

Ok, so
Adapter.DefaultUseEnsureVisible is applied globally
But a the instance property is used only for an adapter instance?

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

Re: Debugging in Visual Studio

Post by Support Team » Mon Oct 05, 2009 6:25 pm

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