Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

The way I know of sending keys using the WebDriver Python bindings is as follows:

element.send_keys(value)

How can I send a key (specifically the Escape key) to no element in particular, just to the window in general?

share|improve this question
    
You can send the keys to the body of the html page. Or do you mean you want to send keys to the browser itself, and not to something rendered on the page? –  Dale Emery Jan 20 '12 at 22:39
    
"specifically the Escape key" Are you attempting to dismiss/close a pop-up dialog perhaps? –  Bj Rollison Jan 21 '12 at 5:12
    
Yes, I'm attempting to close a dialog. –  Randomblue Jan 21 '12 at 11:30
add comment

1 Answer

up vote 2 down vote accepted

How do I handle pop up windows?

WebDriver offers the ability to cope with multiple windows. This is done by using the "WebDriver.switchTo().window()" method to switch to a window with a known name. If the name is not known, you can use "WebDriver.getWindowHandles()" to obtain a list of known windows. You may pass the handle to "switchTo().window()".

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.