'How can I send one characters each time instead of one word in selenium with C#
I wrote the following code. Instead of sending "LHR" I want to send it in 3 sentence each character each time.
IWebDriver driver;
driver = new ChromeDriver();
driver.Manage().Window.Maximize();
driver.Navigate().GoToUrl("https://www.google.com/travel/flights?hl=en-US");
driver.FindElement(By.CssSelector("#i15 > div.e5F5td.BGeFcf > div > div > div.dvO2xc.k0gFV > div > div > input")).SendKeys("LBH");
Solution 1:[1]
I have checked and I am able to send all three or more character together, please use the action method to do it like below.
Actions action = new Actions(driver);
ele = driver.findElement(By.cssSelector("yourselector"))
action.moveToElement(ele).click().build().perform();
action.moveToElement(ele).sendKeys('LAHORE').build().perform();
Import
import org.openqa.selenium.interactions.Actions
Make sure to use the correct locator.Also, i tested with java, I am sure you can change it to desire language
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Akzy |
