Keyword Issue in Get Element count

Hi all, I’m using RPA.Browser.Playwright in my robocorp VS.code environment. I need to proceed the Try block if i found a element or else I need to execute if i found another element in, so i used Get Element Count in my code, now the issue is it need to return the count of element if element is found but it returns zero. i don’t know why this issue happens
i used get element count like
${count} Get Element Count xpath
Try
If ${count} > 0

Try
Get Element Count xpath > 0
I used both this syntax but im getting zero if the element also present

other keywords like wait for element state waits foe 10sec or the timeout we gave in try block and then proceed to except, I need to avoid the extra time

If Get Element Count returns zero it means there are no matches to your xpath

yeah I know that, issue is there is a element in that page which matches the xpath.
Im using RPA.Browser.Playwright so i didn’t give any sleep for page to load is that maybe a problem

You also need to consider that you element might be inside iframe or shadow-root. In that case you need adjust playwright selector accordingly.

1 Like

ok, will look into it