Websdriver - sendKeys command is not typing on Password type field
There were two password fields and one is hidden. Solution is to click on first password [hidden] field to get second password field enabled.
driver.findElement(By.id("FWloginUsername")).sendKeys("aug2qatestingqa@yahoo.com");driver.findElement(By.id("FWloginPassword")).click();driver.findElement(By.id("FWloginPassword2")).clear();driver.findElement(By.id("FWloginPassword2")).sendKeys("webs");
I had almost a similar situation for Password field. There were two elements for the same 'Password' field but with different IDs. The JavaScript was toggling "type = password" on run time for a click, clear or any action to this field.
Solution in this case is to find the text with input type = password
,
for example:
driver.FindElement(By.CssSelector("input[type='password']")).SendKeys(IWebElement);
My problem was that I used ActionChains
which caused the later fields not being filled when using send_keys method.
The solution was to call actions.reset_actions()
e.g.
actions = ActionChains(driver)actions.key_down(Keys.LEFT_CONTROL).send_keys("a").perform()actions.key_down(Keys.LEFT_CONTROL).send_keys("c").perform()actions.reset_actions()# now send_keys() method works again