Page 1 of 1

Command screen hiding the browser

Posted: Fri Sep 07, 2012 1:28 pm
by Florian
Sometimes, when the test starts running, the black command screen remains on top and hides the browser. In that case, if the test has to click on a link behind this screen, the test fails.

It is what I suppose it happens.
What do I have to do? Add a 'focus' action on the whole browser?

Re: Command screen hiding the browser

Posted: Fri Sep 07, 2012 1:54 pm
by odklizec
Hi Florian,

Yes, setting the focus to AUT should help. At least it helped in my projects. I'm doing it via "User Code" action added right after the AUT initialization line. This code brings the application to foreground. Just replace the application name with your AUT name.

Code: Select all

        public void Set_Focus()
        {
        	repo.applicationname.Self.Activate();
        }
Hope this helps?

Re: Command screen hiding the browser

Posted: Fri Sep 07, 2012 2:34 pm
by Florian
Thanks for your answer.

I would use this command:

Code: Select all

repo.MyApplicationName.Self.EnsureVisible
This method should be great I guess.

Re: Command screen hiding the browser

Posted: Fri Sep 07, 2012 2:53 pm
by Support Team
Hi,

Yes, EnsureVisible should make the application visible again.
Activate makes the following: "Activating a form brings it to the front if this is the active application, or it flashes the window caption if this is not the active application. The form must be visible for this method to have any effect."

Regards,
Markus
Ranorex Support Team