Send keys without specifying element in python selenium webdriver

I have a page whose source code is not available, but there is an input field in which the cursor blinks.

Can I write something in a text box without finding an element. I mean, somehow, when the submit key can automatically search for the input focus field and enter input into it.

My code is not working obviuosly

driver.send_keys("testdata")
+4
source share
1 answer

I decided

from selenium.webdriver.common.action_chains import ActionChains
actions = ActionChains(self.driver)
actions.send_keys('dummydata')
actions.perform()
+5
source

Source: https://habr.com/ru/post/1609792/


All Articles