Skip to content

Commit

Permalink
replacing dispatch event with regular click to make it work with all …
Browse files Browse the repository at this point in the history
…clicks
  • Loading branch information
shriyanshagnihotri committed Nov 19, 2024
1 parent f1c4ac6 commit 9496333
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions testzeus_hercules/core/tools/click_using_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,19 +498,19 @@ async def perform_javascript_click(
element.dispatchEvent(event);
} else {
// Default to left click
event = new MouseEvent('click', {
bubbles: true,
cancelable: true,
view: window,
button: 0 // 0 represents the left mouse button
});
element.dispatchEvent(event);
// event = new MouseEvent('click', {
// bubbles: true,
// cancelable: true,
// view: window,
// button: 0 // 0 represents the left mouse button
// });
// element.dispatchEvent(event);
element.click();
}
let ariaExpandedAfterClick = element.getAttribute('aria-expanded');
ariaExpandedAfterClick = element.getAttribute('aria-expanded');
if (ariaExpandedBeforeClick === 'false' && ariaExpandedAfterClick === 'true') {
return "Executed " + type_of_click + " on element with selector: " + selector + ". Very important: As a consequence, a menu has appeared where you may need to make further selection. Very important: Get all_fields DOM to complete the action.";
}
Expand Down

0 comments on commit 9496333

Please sign in to comment.