I have a script in which I click a button and the cursor begins blinking. All my attempts at specifying the element via xpath/id/class name to send the keys from have failed. So, I am attempting to just send the keys to where the cursor is blinking.
I've tried a few solutions:
from selenium.webdriver.common.action_chains import ActionChains
actions = ActionChains(driver)
actions.send_keys('dummydata')
actions.perform()
This solution did not send any keys at all.
- Switch to the active element.
elem = driver.switch_to.active_element()
elem['value'].send_keys('dummydata')
#OR#
elem.send_keys('dummydata')
In this instance, I received error:
elem = driver.switch_to.active_element()
TypeError: 'WebElement' object is not callable
Not sure what else to try at this point. Baffled at why this is happening.