Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox browser remains minimised when Windows is locked/disconnected #872

Closed
realfaisalk opened this issue Aug 15, 2017 · 7 comments
Closed

Comments

@realfaisalk
Copy link

realfaisalk commented Aug 15, 2017

Firefox Version
55.0 (32-bit)

Platform
Windows 10 version - 1703, build 15063.138

Other
geckodriver 0.18.0
Selenium WebDriver 3.4.0 (C# DotNet)

Testcase

Could be related to #703?
If I run my test cases on a Windows 10 VM via Test City, If I am not physically logged into the machine, then Firefox is started minimised (even though I have the code driver.Manage().Window.Maximize();

If I log in part way through the tests then I can see that FF is open but in minimise mode. The only way I can bring the browser up is by having to go to the Firefox process in Task Manager, right-click and select "Maximise"
ff_maximise

As a consequence all tests fail with a Timeout exception

If I am logged in then FF browser is maximised.

This was not an issue with FF v54 and geckodriver 0.16.0

Stacktrace

N/A

Trace-level log

When I can figure out how to change the logging level in C# from Debug....

@whimboo
Copy link
Collaborator

whimboo commented Aug 16, 2017

Does a test before minimizes the window? Or is that visible when starting the first test? The latter I cannot believe because it doesn't happen in all of our cases.

So is that a problem with geckodriver 0.18 and Firefox 54? Or did it start with Firefox 55? If the latter is the case could you check the beta releases and tell us which version first showed this behavior? The builds can be found here: http://archive.mozilla.org/pub/firefox/releases/. Thanks.

@eugenedani
Copy link

eugenedani commented Aug 17, 2017

I suppose we have the same issue. FF window is not open at all from the begging of test script. Our test error screenshot looks like this
ff55_issue

but it should be like this
ff55_expectedpage

We run it like this
We run Selenium HUB on one VM (virtual machine) and Selenium Node on another VM with Windows 10. If I connected to Selenium Node VM by Remote Desktop test is run as expected. I can see it.
When I close Remote Desktop without log off, just close it, and run the test again, test is failed and FF window is not open (see screenshot). If I connected to VM by Remote Desktop during test running I can see FF icon in Windows task bar but no FF window is open and I cannot open it by mouse

Hope it will help to reproduce it

Windows 10 (build 14393), FF55 (64 - bit), Selenium 3.4.0, geckodriver 0.17

@eugenedani
Copy link

eugenedani commented Aug 17, 2017

Also I checked the beta releases. It works as expected with FF 54.0.1 but stops working from FF55.0b1

@eugenedani
Copy link

Hi @whimboo, any updates?
Looks like the same issue is with FF55 headless mode on linux. in our case Ubuntu16.

@eugenedani
Copy link

eugenedani commented Aug 24, 2017

Ok, if someone has the same issue and is still looking for solution.
The issue appears if you use webDriver.manage().window().maximize();
Firefox reaction on maximize() method was changed. More information is here https://bugzilla.mozilla.org/show_bug.cgi?id=1391691

If you use WebDriver like this

WebDriver webDriver = FirefoxDriver();
webDriver.manage().window().maximize();

when if you run tests on locked/disconnected Windows virtual machine Firefox will be minimized and Firefox behavior will be as I described in previous posts.

So there are 2 ways how to resolve the issue.

  1. do not use maximize() method
  2. check browser window size and use maximize() when window is not maximized. Something like this

int widthBeforeMaximize = webDriver.manage().window().getSize().width;
webDriver.manage().window().maximize();
if (webDriver.manage().window().getSize().width < widthBeforeMaximize) {
webDriver.manage().window().maximize();
}

because in FF55 and 56 maximize() method will return the window to normal window state if the window is already maximized.

It should be fixed in FF57 https://bugzilla.mozilla.org/show_bug.cgi?id=1391691

@andreastt
Copy link
Contributor

If this is the problem:

int widthBeforeMaximize = webDriver.manage().window().getSize().width;
webDriver.manage().window().maximize();
if (webDriver.manage().window().getSize().width < widthBeforeMaximize) {
webDriver.manage().window().maximize();
}

Then https://bugzilla.mozilla.org/show_bug.cgi?id=1391691 will have fixed this.

@lock
Copy link

lock bot commented Aug 17, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants