Element not found

Good afternoon people,
a help please,
The robot does not find the elements to inform in the fields.
I have to enter a portal and then fill in some mandatory fields.
The first CPF field does not find the locator.
The field’s xpath is // input [@ id = ‘CPF’]
I already put it with xpath, I put it without, just informing id = CPF, I already used the name, I put the full xpath.
Looks like the element is not on the page. Someone please?

You should try to edit your message and add the exact keyword and locator you used in your test, and use the formatting style (the symbol </> on the message edit box).
Also pasting the exact error message is a good practice to avoid ambiguity.

Did you did a Ctrl-F with the xpath expression on the Dev Tools of the browser (F12)?
It is very frequent problems with timing that makes keywords not finding the elements. Are you sure this is not the case?

(you used spaces in your locators and that does not appears to be correct)

hello Helio,

Yes, I used CTLR + F, I used TrueXpath tmb, to get the correct locator, but I can’t find it, below I’ll put all the exemples I’ve done.

Well, I was expecting text, not images. And you did not show the exact keyword call.

Anyway, there are other factors that can interfere with locating the element:

  • The page is not totally rendered when you try to access the element. Try to add a hard pause Sleep 2 seconds or better to use a Wait Until Element Is Visible (or others from this Wait family)

  • The element may be inside a Frame, and so you need to select it before trying to find it.

Before doing the Input, I put a Wait Until Element Is Visible, but it didn’t work.

Example without the input
Wait Until Element Is Visible      css=#main > div:nth-child(2)

Element 'css=body > div > div > div.wizard.row > a:nth-child(2)' not visible after 5 seconds.

I removed the spaces, but it gave the same result
Element 'css=body>div>div>div.wizard.row>a:nth-child(2)' not visible after 5 seconds.

Looking through F12, it appears to be inside a frame or container.

In this case I need to send you an image

So just Select Frame before using it :).

Thank you Hélio,
It worked, I really had to select the iframe first.

1 Like