The new JS enabled page of http://mail.google.com is making trouble to get ID of password input field. However, I've navigated from email ID page with its ID - identifierID
.
Help me to get ID of password field.
Thanks in advance...
The new JS enabled page of http://mail.google.com is making trouble to get ID of password input field. However, I've navigated from email ID page with its ID - identifierID
.
Help me to get ID of password field.
Thanks in advance...
Use a combination input element and the div having Inner text
<div jsname="YRMmle" class="AxOyFc snByac" aria-hidden="true">Enter your password</div>
.Also on clicking the correct element, the parent element changes which makes you to find the element again and send the value.
You can use CssSelector or Xpath to attain this easily. But you Google will definitely be changing this so often.
Please find the updated code:
Code:
I have validated it on my end. Let me know if this doesn't work.
Instead if Id use name attribute to get access of the field.
It will give you password input element.
Try to set the value of the field using JavaScript
as
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("var elements = document.getElementsByName('password');elements[0].setAttribute('value', '123');");