schickling/chromeless

Wait for element which exists on next page

Opened this issue · 4 comments

Hello,

Thanks for awesome project. I have a question.
Scenario:- I need to extract user Full name once they successfully login.
Problem:- I need to wait till the home page load after login is done. How can I wait for page load after successful login ?
My working code with hard coded wait time out. Any improvement on this ?

  const screenshot = await chromeless
    .goto('login url')
    .type(config.username, 'input[id="userId"]')
    .type(config.password, 'input[id="password"]')
    .click('#btnSubmit');

  await chromeless.wait(config.waittime) // this is a bad wait
  const fullName = await chromeless.inputValue('input[id="fullName"]');

My suggestion is wait for the last element of the homepage is loaded

Tried that. but not working.I will have a second look though.

If you try to wait('input[id="fullName"]'), then extract user Full name, what happens? Does it work? If not, could you please attach the log?

No , it is not working @sonnguyen1989 . It is just fetching blank data