try catch
This commit is contained in:
@@ -769,20 +769,25 @@ class CommandorPage {
|
||||
} else {
|
||||
logWithDevice("this.browser.isConnected() is " + this.browser.isConnected(), this.device)
|
||||
if (this.browser.isConnected()) {
|
||||
let pages = await this.browser.pages();
|
||||
logWithDevice("get pages", this.device)
|
||||
try {
|
||||
let pages = await this.browser.pages();
|
||||
logWithDevice("get pages", this.device)
|
||||
pages.forEach((currentPage) => {
|
||||
if (currentPage.url() === RDV_URL) {
|
||||
this.page = currentPage;
|
||||
}
|
||||
})
|
||||
logWithDevice("this.page.bringToFront();", this.device)
|
||||
await this.page.bringToFront();
|
||||
// this.page = pages;
|
||||
// this.page.await
|
||||
await this.fillFields(this.page)
|
||||
await delay(2 * 1000);
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
this.isTerminated = true
|
||||
}
|
||||
|
||||
pages.forEach((currentPage) => {
|
||||
if (currentPage.url() === RDV_URL) {
|
||||
this.page = currentPage;
|
||||
}
|
||||
})
|
||||
logWithDevice("this.page.bringToFront();", this.device)
|
||||
await this.page.bringToFront();
|
||||
// this.page = pages;
|
||||
// this.page.await
|
||||
await this.fillFields(this.page)
|
||||
await delay(2 * 1000);
|
||||
}
|
||||
}
|
||||
// if (!this.browser.isConnected()) {
|
||||
|
||||
Reference in New Issue
Block a user