Skip to content

Commit f175b9f

Browse files
authored
Merge pull request #886 from getmaxun/button-fix
fix(maxun-core): button click action during robot execution
2 parents 71c39b1 + 288614b commit f175b9f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

maxun-core/src/interpret.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ export default class Interpreter extends EventEmitter {
11691169
}).catch(e => {
11701170
throw e;
11711171
}),
1172-
button.click()
1172+
page.locator(workingSelector).first().click()
11731173
]);
11741174
debugLog("Navigation successful after regular click");
11751175
await page.waitForTimeout(2000);
@@ -1184,17 +1184,17 @@ export default class Interpreter extends EventEmitter {
11841184
}).catch(e => {
11851185
throw e;
11861186
}),
1187-
button.dispatchEvent('click')
1187+
page.locator(workingSelector).first().dispatchEvent('click')
11881188
]);
11891189
debugLog("Navigation successful after dispatch event");
11901190
await page.waitForTimeout(2000);
11911191
paginationSuccess = true;
11921192
} catch (dispatchNavError) {
11931193
try {
1194-
await button.click();
1194+
await page.locator(workingSelector).first().click();
11951195
await page.waitForTimeout(2000);
11961196
} catch (clickError) {
1197-
await button.dispatchEvent('click');
1197+
await page.locator(workingSelector).first().dispatchEvent('click');
11981198
await page.waitForTimeout(2000);
11991199
}
12001200
}

0 commit comments

Comments
 (0)