Page 1 of 1

Bring Browser to the foreground

Posted: Thu Jun 07, 2012 7:20 pm
by Pixi6s
Hello,

I am looking into using Windows Scheduler to run an Ranorex exe on my runtime machine. It starts up fine but it doesn't automatically put the browser in the foreground so the first clicks fail and the script fails. When I run from a cmd prompt the browser is brought to the foreground automatically and I don't have this issue.

I have tried using Focus on the browser DOM and that didn't work.

Thanks

Re: Bring Browser to the foreground

Posted: Fri Jun 08, 2012 1:53 pm
by Support Team
Just a quick hint: Try calling EnsureVisible on the DOM element instead of Focus.

Regards,
Alex
Ranorex Team

Re: Bring Browser to the foreground

Posted: Fri Jun 08, 2012 3:54 pm
by Pixi6s
I did try that as well after my post and it didn't work. Do I do Focus and then EnsureVisible?

Knowing EnsureVisible should work I will mess with it more.

thanks
Sierra

Re: Bring Browser to the foreground

Posted: Mon Jun 11, 2012 1:42 pm
by Support Team
Hi,
Do I do Focus and then EnsureVisible?
No, EnsureVisible should work, do you have used the EnsureVisible method of your WebDocument?

Regards,
Markus
Ranorex Support Team

Re: Bring Browser to the foreground

Posted: Mon Jun 11, 2012 2:27 pm
by Pixi6s
With Ensure Focus I can see that it tries to give the browser focus, in the start bar it starts blinking orange like it needs focus, but it doesn't actually bring it to the foreground so it cannot, say, type in the text boxes.

Any other ideas?
Sierra

Re: Bring Browser to the foreground

Posted: Mon Jun 11, 2012 3:24 pm
by Pixi6s
I open the browser, wait for it to load in, then I have EnsureFocus on the Browser Dom. Even if I minimize everything and set the scheduler to run, the cmd prompt that comes up to run the executable will retain focus with the browser behind it. The browser will be blinking to try and get focus.

Re: Bring Browser to the foreground

Posted: Tue Jun 12, 2012 3:04 pm
by Support Team
Hi,

Do you mean EnsureVisible?
The browser will be blinking to try and get focus.
Could it be that some kind of a message box is poped up?
Do you have already tried to click on the windows task bar to bring the browser in foreground?

Regards,
Markus
Ranorex Support Team