javascript - Angular + Selenium: Cannot get value from input field -


i have written tests in protractor , i've used expect statement:

loginpage.email.sendkeys( params.login.email ); expect(loginpage.email.gettext()).toequal( params.login.email ); 

however, test failing because signuppage.email.gettext() returning empty string. couldn't find function call in selenium's documentation input field return correct value?

in protractor.conf file:

 params: {       login: {         email: 'user@email.com',         password: 'blahblah123'       } 

error in terminal:

expected '' equal 'user@email.com'.

so i'm trying match input of email field same email address i've sent through. suggestions how in selenium?

if input field, need value of value attribute:

expect(loginpage.email.getattribute("value")).toequal(params.login.email); 

similarly, apply saifur's idea here, if need wait element contain desired value, use texttobepresentinelementvalue expected condition:

var ec = protractor.expectedconditions; browser.wait(ec.texttobepresentinelementvalue(loginpage.email, params.login.email), 5000); 

note timeout value (in ms) has specified.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -