I cant find the message in the source

Hi ,
when i use puppeteer to login page i have this response message
e
but i cant find it on the source


how to handle it by keycheck ?
thanks

Use the Get Dom block first and then do the keycheck

i did it but the error message not in the source !

It’s in the DOM for sure. Everything you see on the screen is on the DOM. Maybe you just need a delay or wait for element block first?

no i tried delay and wait for element but it didnt work
the page didnt reload and the source didnt change so the error message not the source

Can you please post the LoliCode? Censor the URLs

BLOCK:PuppeteerOpenBrowser
ENDBLOCK

BLOCK:PuppeteerNavigateTo
  url = "https://mail.ionos.com/"
ENDBLOCK

BLOCK:PuppeteerWaitForElement
  findBy = XPath
  identifier = "//*[@id=\"login-form-user\"]"
ENDBLOCK

BLOCK:PuppeteerTypeElement
  findBy = XPath
  identifier = "//*[@id=\"login-form-user\"]"
  text = "[email protected]"
ENDBLOCK

BLOCK:PuppeteerTypeElement
  findBy = XPath
  identifier = "//*[@id=\"login-form-password\"]"
  text = "lkwgmkldsmvl"
ENDBLOCK

BLOCK:PuppeteerClick
  findBy = XPath
  identifier = "/html/body/main/div[2]/div/div/div[2]/div/div/form/footer/button"
  SAFE
ENDBLOCK

BLOCK:PuppeteerGetDOM
  SAFE
  => VAR @o
ENDBLOCK

i tried to login with wrong details to see the error message

@Ruri when the DOM block executed i cant find the error message on it

After getting the dom to the variable called o you have to do the keycheck on that specific variable, not on data.SOURCE. Are you doing that?

Well, as soon as you click it will proceed to the next block, it doesn’t wait for the error message to appear, that’s why you’re not getting it…
You need to add a delay before the Get DOM. Try it.

yes i did it but u have ban as a result

ill try it now and tell you

Just to add I would recommend changing your xpath to something a little more general like
//button[contains(text(),"Login")]

The code you have there now works but if they were to make any change to the site it would stop working, where the one I posted will look for any button that says Login.

Alt you can also use CSS button[data-i18n="oao.login"]

Basically the idea is to use something as broad/specific as can be to be able to always find the button no matter what happens to the rest of the code.

2 Likes