Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
367 views
in Technique[技术] by (71.8m points)

Java - How to check PC sleep mode (Quartz Scheduler + Selenium)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...