Command screen hiding the browser

Ask general questions here.
Florian
Posts: 75
Joined: Fri Jul 27, 2012 12:57 pm
Location: France (Lyon)
Contact:

Command screen hiding the browser

Post by Florian » Fri Sep 07, 2012 1:28 pm

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?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Command screen hiding the browser

Post by odklizec » Fri Sep 07, 2012 1:54 pm

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Florian
Posts: 75
Joined: Fri Jul 27, 2012 12:57 pm
Location: France (Lyon)
Contact:

Re: Command screen hiding the browser

Post by Florian » Fri Sep 07, 2012 2:34 pm

Thanks for your answer.

I would use this command:

Code: Select all

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Command screen hiding the browser

Post by Support Team » Fri Sep 07, 2012 2:53 pm

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
.
Image