Search code examples
seleniumtaskscheduled-tasksresolutionwindows-task-scheduler

screen resolution in mode "Run whether user is logged on or not", in windows task scheduler


I am using Python 2.7 and Selenium 2.39.0. to test a web application. When I run my test as a Windows (7 Ent.) scheduled task with the option "Run whether user is logged on or not", it looks like the screen resolution or window sizing changes; Some buttons become hidden behind the toolbar at the bottom of the browser window and therefore, it can't be clicked by Selenium.

I don't have this problem if I choose the option "Run only when user is logged on"; even if the screen is locked, the buttons are visible and clickable.

According to the Windows task properties, it is using the same user account.

Is there a way, browser setting or a registry key which can help to keep the same resolution and size in both modes?

I know I can scroll down the page, but I am trying to understand and may be prevent this difference of behavior between these two modes.


Solution

  • I've had the same problem. I tried all registry keys I could find, disabled TMM, but to no avail.

    Running Selenium with a user logged in seems the only way Windows 7 will give you another resolution than 1024x768. So I ended up setting my Selenium virtual machine like that: have a user log in automatically on startup and launch the Selenium node after that.