I'm trying to fill out a form in Selenium2.
One input has an autocomplete that I want to close, preferably by sending esc after the search term.
I.e. something like driver.FindElement(By.Id("InputWithAutocomplete")).SendKeys("SearchTerm/ESC");
Keys that I would also like to send include del and ctrl+ a.
Is there a list of special characters that I can use?
I'm using Selenium for .NET 2.8 with the FirefoxDriver.
sendKeys command does not work with Select elements and the only way to automate selection option is by using javascript.
sendkeys() is a method in Selenium that allows QAs to type content automatically into an editable field while executing any tests for forms. These fields are web elements that can be identified using locators like element id, name, class name, etc.
We can input text in the text box without the method sendKeys with thehelp of the JavaScript Executor. Selenium executes JavaScript commands with the help of the executeScript method.
Try this:
WebElement list1;
list1=firefoxDriver.findElement(By.name("lst"));
list1.sendKeys(Keys.CONTROL);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With