-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Capybara with Selenium-webdriver: button found but not clicked #2780
Comments
In doing some research (mostly reading this closed Issue from a merged PR: #2422) I now see the we can send keypresses directly to the current session with Is there a way to send the keyboard control code or whatever the browser equivalent is for the ENTER key so that I can submit the form? Thank you! |
Scratch that last question, for anyone else finding this thread in the future, the way to send control codes directly to the underlying driver (Selenium for Chrome in this case: https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings#api-example) is to simply send the key as a symbol like so:
|
I'm having a similar issue when the button to be clicked is near the bottom of the viewport. (If the button is totally out of the view, capybara scrolls and clicks the button correctly, the issue ocurrs only when the button is found inside the viewport but it is near the bottom border). So a workaround i'm using is to modify the views to change the position of those buttons a bit. |
Download chromedriver latest version. |
Meta
Capybara Version: 3.40.0
Driver Information (and browser if relevant): selenium-webdriver 4.10.0 and Chrome
Expected Behavior
"Continue" button is clicked sending a POST request to my Controller and advancing the setup flow.
Actual Behavior
"Continue" button is located, click is performed but no action is taken.
Steps to reproduce
Capybara is configured to use its default options for selenium-webdriver. The line that is causing the issue is:
find(:xpath, '//*[@id="content"]/div[3]/div/div/div[3]/div/button[1]').click
I've also tried:
click_on 'Submit'
The button needing to be clicked is nothing out of the ordinary:
Can anyone help me track down this issue? I'm willing to open a PR if it's necessary but I'm at a loss for what could be causing the behavior to begin with. Thank you!
The text was updated successfully, but these errors were encountered: