Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upModal issue - (Selenium::WebDriver::Error::ElementNotInteractableError) #6377
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
twalpole
Sep 7, 2018
Contributor
@BigGorillaMike there are two elements with an id of username (not valid HTML) on that page - you're finding the first one and it is not keyboard interactable.
|
@BigGorillaMike there are two elements with an id of |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
barancev
Sep 7, 2018
Member
This is a question rather than an issue. Please send questions to the selenium user group
|
This is a question rather than an issue. Please send questions to the selenium user group |
barancev
closed this
Sep 7, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
BigGorillaMike
Sep 7, 2018
Thanks @twalpole, I wrote for keyboard nav and it works
driver.action.send_keys(:tab).perform
driver.action.send_keys('#removed#').perform
driver.action.send_keys(:tab).perform
driver.action.send_keys('#removed#').perform
driver.action.send_keys(:return).perform
BigGorillaMike
commented
Sep 7, 2018
•
|
Thanks @twalpole, I wrote for keyboard nav and it works driver.action.send_keys(:tab).perform |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
twalpole
Sep 9, 2018
Contributor
@BigGorillaMike You don't really need to resort to actions, you just need to make sure you find the correct element
driver.find_element(:css, 'div.visible-lg #username').send_keys(...)
|
@BigGorillaMike You don't really need to resort to actions, you just need to make sure you find the correct element
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
BigGorillaMike
Sep 10, 2018
@twalpole thanks, I was wondering if that would work, but wasn't sure how to write it, this being my first attempt with selenium and it also being the first use of selenium for this company.
BigGorillaMike
commented
Sep 10, 2018
|
@twalpole thanks, I was wondering if that would work, but wasn't sure how to write it, this being my first attempt with selenium and it also being the first use of selenium for this company. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
twalpole
Sep 10, 2018
Contributor
@BigGorillaMike You’re welcome. If you’re using Ruby in your new project you will probably have a much easier time using Selenium via Capybara or Watir rather than using Selenium directly.
|
@BigGorillaMike You’re welcome. If you’re using Ruby in your new project you will probably have a much easier time using Selenium via Capybara or Watir rather than using Selenium directly. |
BigGorillaMike commentedSep 6, 2018
•
edited
Meta -
Linux Xvfb style
ruby-2.1.1/gems/selenium-webdriver-3.11.0/
Code I have written in Ruby
require 'rubygems'
require 'headless'
require 'selenium-webdriver'
headless = Headless.new(display: 99)
headless.start
Selenium::WebDriver.logger.level = :info
--# Selenium::WebDriver.logger.level = :debug #uncomment this if you need to debug
--# opts = Selenium::WebDriver::Firefox::Options.new(log_level: :trace) #uncomment this if you need to debug
capabilities = Selenium::WebDriver::Remote::Capabilities.firefox(accept_insecure_certs: true)
driver = Selenium::WebDriver.for :firefox, desired_capabilities: capabilities#, options: opts #uncomment this if you need to debug
driver.navigate.to 'https://fpdev1098twebsite-env-11.us-east-1.elasticbeanstalk.com/'
puts driver.title
dropDown = driver.find_element(id: 'signInChange')
puts dropDown.displayed?
dropDown.click
student = driver.find_element(name: 'student').click
puts driver.title
wait = Selenium::WebDriver::Wait.new(:timeout => 500)
wait.until {driver.find_element(id: 'username')}
driver.find_element(id: 'username').send_keys '#removed#'
driver.find_element(id: 'password').send_keys '#removed#
driver.find_element(name: 'signInSubmitButton').click
puts driver.title
headless.destroy
Expected Behavior -
I expect it to be able to log in
Actual Behavior - I get the following error
{"value":{"error":"element not interactable","message":"Element <input id="username" class="form-control inputField-customizable" name="username" type="text"> is not reachable by keyboard","stacktrace":"WebDriverError@chrome://marionette/content/error.js:178:5\nElementNotInteractableError@chrome://marionette/content/error.js:286:5\nwebdriverSendKeysToElement@chrome://marionette/content/interaction.js:562:11\ninteraction.sendKeysToElement@chrome://marionette/content/interaction.js:549:11\nsendKeysToElement@chrome://marionette/content/listener.js:1320:9\ndispatch/</req<@chrome://marionette/content/listener.js:489:14\ndispatch/<@chrome://marionette/content/listener.js:484:15\n"}}
WebDriverError@chrome://marionette/content/error.js:178:5: Element is not reachable by keyboard (Selenium::WebDriver::Error::ElementNotInteractableError)
Steps to reproduce -
Run the script.
##Edit
I had a screenshot taken of the page before trying to send_keys to username, attaching the screenshot. which makes this harder for me to understand because clearly the fields are there, don't know why they cannot be selected.