How do I go about locating & getting a value for an element like the following?
<input type="hidden" title="username" value="joe.doe">
Any suggestions much appreciated.
var userNameElm = $('input[title=username]');
it('is present but invisible', function() {
expect(userNameElm.isPresent()).toBeTruthy();
expect(userNameElm.isDisplayed()).toBeFalsy();
});
it('should have proper value attribute', function() {
expect(userNameElm.getAttribute('value')).toEqual('joe.doe');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With