Expecting Null equal to 'Some Value' in Protractor
Mystic last edited by
I enter the value with this code:
var FirstName = element(by.name('firstName')); FirstName.clear().sendKeys('RM');
The code updates the profile of the user correctly.
Now I am trying to read that value or expecting that value in Protractor Visual Studio Code with this code:
I have also tried this:
but it returns a null value
How do I read the value of the First Name field?
getAttribute('firstName')gets the value of the attribute firstName, not the value of the input. Your example element does not have an attribute "firstName". It has attributes id, pattern, name, placeholder, aria-*, etc..
I think you want to use the (in your case hidden) attribute 'value' instead: