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.
CodePudding user response:
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")