Open tgentry-bamboo opened 1 month ago
In doing some research (mostly reading this closed Issue from a merged PR: https://github.com/teamcapybara/capybara/pull/2422) I now see the we can send keypresses directly to the current session with Capybara.current_session.send_keys("ENTER")
.
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:
Capybara.current_session.send_keys :enter
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.
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!