Escape key is not working in Selenium WebDriver with Java
java, selenium, selenium-webdriver
Solution
Based on my experience with the Python bindings, you'd have to call `.perform()` on your action chain. I see the Java bindings have the same method. So:
action.sendKeys(Keys.ESCAPE).perform();
Problem
I am Using Selenium WebDriver framework. I have a scenario where a button gets clicked after the textbox get populated and onblur of the textbox. Below is the code which I used for escape sequence which enable the button after filling in textbox.The button get enabled only when the textbox gets filled and when the focus moves out of textbox. ``` WebDriver driver = new FirefoxDriver(); driver.get("http://localhost:8081/TestAutomation/Escape.jsp"); driver.manage().window().maximize(); WebElement txtBxHandle = driver.findElement(By.name("txtName")); txtBxHandle.sendKeys("Socrates"); Actions action = new Actions(driver); action.sendKeys(Keys.ESCAPE); WebElement BnEnable = driver.findElement(By.name("btnSubmit")); BnEnable.click(); ``` The above code is not working.I tried keyPressNative but in vain. Thanks for the Help.