Currently I am using Quartz Scheduler to schedule an automated (Selenium-based) job at certain time (lets say 3PM) everyday. The job is to automate a health declaration form on a website using ChromeDriver.
The problem is that the PC will crashed (BSOD). It occurs if the PC is sleep when it's 3pm, later (let say 3:20pm) the user will wake the PC up, freeze + crash occur.
I have tried multiple ways but there seems to be no clear tutorial on how to check if PC is in Sleep mode or not. I know many people suggest JNA but I can’t seem to get a good understanding of how to set it up.
Is there any workaround this issue?
Edit:
I have tried experimenting in the Job class, and it seems the crash issue will occur even without Selenium. Hence, I might need to find workaround with the Quartz Scheduler somehow?
question from:
https://stackoverflow.com/questions/65895236/java-how-to-check-pc-sleep-mode-quartz-scheduler-selenium 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…