fix: no cursor position if page closed

This commit is contained in:
Karishma Shukla
2025-08-21 20:23:48 +05:30
committed by GitHub
parent ca29967ce8
commit 93a644b1d8

View File

@@ -541,6 +541,10 @@ export class WorkflowGenerator {
}
if ((elementInfo?.tagName === 'INPUT' || elementInfo?.tagName === 'TEXTAREA') && selector) {
if (page.isClosed()) {
logger.log('debug', 'Page is closed, cannot get cursor position');
return;
}
const positionAndCursor = await page.evaluate(
({ selector, coords }) => {
const getCursorPosition = (element: any, clickX: any) => {
@@ -1342,4 +1346,4 @@ export class WorkflowGenerator {
public clearLastIndex = () => {
this.generatedData.lastIndex = null;
}
}
}