Reputation: 11
I would like to send keys to the whole driver window in the background. So I can have a game window open and the driver will have keys sent to it.
I need to send the keys to just that window.
Upvotes: 0
Views: 1659
Reputation: 33361
You can send keys to the body
element of the web page. It will actually be equally to sending the text to a whole driver window.
This can be done as following:
driver.find_element_by_xpath('//body').send_keys("The text you want to send")
Upvotes: 2