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 da7e38a
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 63 deletions.
101 changes: 48 additions & 53 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ certifi = "^2024.2.2"
cffi = "^1.16.0"
charset-normalizer = "^3.3.2"
click = "^8.1.7"
cryptography = "^42.0.8"
cryptography = "^43.0.1"
diskcache = "^5.6.3"
distro = "^1.9.0"
dnspython = "^2.6.1"
Expand Down Expand Up @@ -82,7 +82,7 @@ rich = "^13.7.1"
rsa = "^4.9"
shellingham = "^1.5.4"
sniffio = "^1.3.1"
starlette = "^0.37.2"
starlette = "^0.40.0"
tabulate = "^0.9.0"
termcolor = "^2.4.0"
tiktoken = "^0.6.0"
Expand Down
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 da7e38a

Please sign in to comment.