Ensuring a Chrome dialog is visible not working

Ask general questions here.
User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Ensuring a Chrome dialog is visible not working

Post by Aracknid » Thu Oct 17, 2013 8:38 pm

Hi,

I've using Ranorex 4.0.6 and Chrome 30.

When a message box appears in Chrome, Ranorex Spy shows this as a Form. I can easily write code to work with the message box. However, I cannot figure out how to make the form visible if another window is over it, for example while stepping over code in Visual Studio.

So, say I have a Ranorex Form object, 'MyForm' for this Chrome message box. If I'm debugging and in Visual Studio and I step over the line (or a function) which has MyForm.EnsureVisible it doesn't work.

In Spy, if I right click on the Form and choose Ensure Visible or Activate it doesn't bring it to the front. This does work for the main Chrome Form though. Oddly enough, Focus does work. But MyForm.Focus doesn't work in code.

This same code works fine with IE.

Any thoughts?

Aracknid.

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

Re: Ensuring a Chrome dialog is visible not working

Post by Ciege » Thu Oct 17, 2013 11:07 pm

Just a possible workaround... You can issue a .minimize and a .restore on the window. That should bring it to the front.

But, if you are debugging in VS, VS might be taking the foreground when the step occurs...
VS in foreground.
F11
Ranorex performs an action
VS in foreground
F11
Ensure visible
VS needs to take foreground again so that you can F11 the next line of code...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Aracknid
Posts: 342
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: Ensuring a Chrome dialog is visible not working

Post by Aracknid » Fri Oct 18, 2013 2:13 pm

Thanks for the work around. I'll try it out.

About the stepping through VS... When I use IE it does switch it to the message box (in IE it's a #32770 dialog) and I do see it appear and then it switches back to VS. Or more specific, if I step over my entire function that handles the message box, it switches to it and clicks the button I want in the message box and returns that it was handled correctly. It also works for FF as well, but firefox is slightly different and I think my code to handle it is cased to do something different. But the Chrome code and the IE code are the same.

For Chrome it does not switch to it even when I step over the function. It gets stuck truing to find the button to click because the message box was not brought to the front. I'm using EnsureVisible to force the switch (to bring it to the front).

Thanks,

Aracknid