I am trying to write a program for Gmail login using Selenium. I am able to hit URL, enter username and click "Next" button, but when I redirected to "Password" field page I am unable to locate that element. I tried the same using by.className. Following is the inspected code for field:
<input class="whsOnd zHQkBf"
jsname="YPqjbf"
autocomplete="current-password"
spellcheck="false"
tabindex="0"
aria-label="Enter your password"
name="password"
autocapitalize="off"
autocorrect="off"
dir="ltr"
data-initial-dir="ltr"
data-initial-value=""
badinput="false"
type="password">
and following is selenium code I have written:
driver.findElement(By.className("whsOnd zHQkBf")).sendKeys("Password");
I also tried using Id, by using parent <div id ="password"....>, but it didn't work.
Please let me know the solution.