The element is not being clicked in the browser, but there’s no error in the test

Hello, I’m new to using Robot Framework, and I’m facing an issue when trying to click an element. The test finishes without any errors, but the last element is not clicked.

I’m using commands like Wait Until Element Is Visible and Element Should Be Visible to ensure that the element is actually visible. Despite this, during the test execution, the element is not clicked. Can anyone help me with this?

my code:

html:

html:

test:

Hi,

An element might be found and click, otherwise the test would fail.
Looking at your screens I assume you’re using Seleniumlibrary, and would check this:

  • In DOM/page inspector ${WORKSPACE} xpath is found and unique (maybe some other locator is clicked)
  • Maybe try with a more precise xpath end //option[@text()=‘area de trabalho’]
  • The “Visible” keywords usually mean logically visible. So if element is already in the DOM, the keywords and click might be really fast. Try to set the Sleep before the click
  • You have a Select for your element, so you could use Select From List By Index or By Label (strange thing is that select as no easy attribute apart from aria-hidden)
  • Finally is the element really clickable (I mean in debug mode step by step, is the element available and not greyed or else).

Btw, as Select, ${CREATED_MAP} is a “standard” button, so you could use Click Button instead of click element (test would be clearer to understand and read).

Regards
Charlie

1 Like

I used Select From List By Label, and my option was selected.
I just needed to remove Click Button ${BUTTON_WORKSPACE} since clicking it opened the options dropdown and didn’t close it.
Thank you for the response; my issue was resolved.

1 Like