Element not found but test passed

Good morning, @grylion54 @kazurayam @Jass
I’ve an issue I don’t quite understand, can someone help me?

script :

Actual error :

html :

Object :

Actual result UI :

So I don’t know why this error displayed, while my denomination (Katakon Studio) is created.

Thank you for your suggestion :upside_down_face:

I suppose the target HTML has <iframe>, doesn’t it?

If so you need to apply:

@kazurayam
please I didn’t catch what you said exactly.

thanks!

What @kazurayam is suggesting is that above the HTML code you have shown may be an <iframe> tag. That could “hide” the element that you are trying to interact with. Read the “Switch to Frame” documentation to get more information to fix your concern.

Since you are some ways into your TC (line 178), another option is to insert some “wait” or “delay” into your TC to ensure the element is visible on the page at the time you want to interact with it.

@ferrariklersone This is where knowing how to use the Inspector tool comes in handy. Do the following for me:

1.) Navigate to the page which has the text field in question.
2.) Press F12 on your keyboard. This will open the inspector.
3.) Open the Console tab.
4.) Enter the following in the console: $x("//input[@id=‘ct10_CONTENU_PAGE_libelleFr’]")
5.) If you get one or more results, your locator is correct. If not, it is incorrect.

As others have said, if you can’t find the element this way, it’s possible that it is a child of an <iframe> element. We cannot see it in the HTML that you shared, but it may be further up in the ancestry. If so, you’ll need to switch to this frame before any locator will be able to find the element.

@Brandon_Hein Hello
I tried to follow your suggesting, but i got no information.

Do you want me to post all the HTML on this part, so you can see what’s wrong?
Otherwise I’m a little lost …

Just check if there is an <iframe> element in your HTML. You can search for it using:

$x("//iframe")

it does not exist in the HTML code

Ok, and this xpath doesn’t return anything either?

$x("//input[@id=‘ct10_CONTENU_PAGE_libelleFr’]")

You are putting it into the Filter field. Rather, put it into the actual console… (after the >)

It’s clear that you are not familiar with the Inspector tool. Please review this post:

Replace the ‘ characters with '. The forum likes to do formatting that messes with it.

I tried again with this :

Try this with the other xpath, the one for the <input>:

$x("//input[@id='ct10_CONTENU_PAGE_libelleFr']")

image

That is not what I posted. Try again:

$x("//input[@id='ct10_CONTENU_PAGE_libelleFr']")

like that?

Ok so there’s no <iframe> and there’s no <input>. I’m at a loss… are you doing this on the correct page?