set to random store and try catch

This commit is contained in:
2022-09-17 15:35:30 +02:00
parent 726e4244dc
commit f822cd455c
2 changed files with 27 additions and 1 deletions
+3 -1
View File
@@ -229,7 +229,9 @@ class CommandorPage {
try {
if (!this.page.isClosed()) {
this.page.evaluate(() => {
document.getElementsByClassName("btn")[0].focus();
let element = document.getElementsByClassName("btn")[0];
if (typeof element !== 'undefined')
document.getElementsByClassName("btn")[0].focus();
})
await delay(getRandomWaitTime())
if (!this.page.isClosed()) {