Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to perform click at disabled elements #2635

Closed
ilya-corp opened this issue Jan 31, 2024 · 0 comments · Fixed by #2636
Closed

Add ability to perform click at disabled elements #2635

ilya-corp opened this issue Jan 31, 2024 · 0 comments · Fixed by #2636
Assignees
Labels
Milestone

Comments

@ilya-corp
Copy link

ilya-corp commented Jan 31, 2024

The problem

Currently Selenide requires element interactable state to perform click:

Element should be clickable: interactable and enabled.

There are some use cases when we need to click at visible, but disabled element. For example, we may want to click at disabled button to reset focus from an editbox or to check that nothing happened.

Details

The idea is to add new option for click allowDisabled().

Example of usage:

$(By.cssSelector("button.primary")).click(ClickOptions.allowDisabled());

Tell us about your environment

  • Selenide Version: 7.0.4
  • Chrome\Firefox\IE Version: Chrome 121.0.6167.139
  • OS Version: Windows 10

Code To Reproduce Issue

$(By.cssSelector("button.primary")).click(ClickOptions.allowDisabled());
@asolntsev asolntsev self-assigned this Feb 2, 2024
@asolntsev asolntsev added this to the 7.1.0 milestone Feb 2, 2024
@asolntsev asolntsev linked a pull request Feb 2, 2024 that will close this issue
asolntsev added a commit that referenced this issue Feb 4, 2024
NB! It's important to call `e.click()`, not `actions.moveToElement(e, 0, 0).click().perform()`
because the latter doesn't check that the element is covered by other element, and doesn't throw "element is not clickable at point. Other element would receive the click" error.
asolntsev added a commit that referenced this issue Feb 4, 2024
NB! It's important to call `e.click()`, not `actions.moveToElement(e, 0, 0).click().perform()`
because the latter doesn't check that the element is covered by other element, and doesn't throw "element is not clickable at point. Other element would receive the click" error.
asolntsev added a commit that referenced this issue Feb 4, 2024
NB! It's important to call `e.click()`, not `actions.moveToElement(e, 0, 0).click().perform()`
because the latter doesn't check that the element is covered by other element, and doesn't throw "element is not clickable at point. Other element would receive the click" error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants