4

I have made sure that the mac does not sleep by adjusting the settings in the system preferences. Jenkins will start the test on a schedule, the browser comes up but the test fails because the page is blank.

The same test works with no problem if the mac is unlocked or the screen save is not up.

I cannot leave the mac unlocked because the test runs at night and its a security issue.

Has anyone encountered this issue? And have a solution. Please share.

Attaching some logs. This image will give an idea of what I am describing.

Screenshot of logs

ascripter
  • 5,665
  • 12
  • 45
  • 68

1 Answers1

1

You can try to run tests on locked computer when:

  1. you set your display never turn off, when you lock your computer
  2. you made sure, that computer never goes in hibernate or sleeping mode

If it will not work you can use two more possibilities:

  1. run your tests on headless browser. Here is a pretty good explanation how to do it.
  2. run your tests on a remote screen via VNC or RDP

EDIT:

You can try not lock the screen, but instead start the screensaver, and require the screensaver to immediately require a password.

Andrei Suvorkov
  • 5,559
  • 5
  • 22
  • 48
  • I tried with the screen saver up in the mac, same result. And when the mac is locked the screen goes dark, so that does not help (the mac never sleeps though and that's why this is so confounding).My issue is not resolved. I cannot use VNC because IT security will not allow it. – user9832094 Jun 11 '18 at 18:56
  • I have edited my answer, please have a look and tell me if it works. Have you tried https://itunes.apple.com/us/app/amphetamine/id937984704?mt=12 or https://github.com/newmarcel/KeepingYouAwake or https://caffeine.en.softonic.com/mac?ex=BB-463.1. I'm not sure if they prevent a screen from turning off, when mac is locked. Didn't find information about it – Andrei Suvorkov Jun 11 '18 at 20:37
  • I installed amphetamine and ran test with screen saver and also just by locking the screen and the screen was not dark at any time. Still the same result. – user9832094 Jun 13 '18 at 06:36
  • Hey @user9832094 Were you able to fix it? I am facing the same issue – parul Feb 11 '22 at 23:22