AssertElementPresent detects element that is not visible

Hi everybody,

i added the following part to interrupt my script when an upload limit is reached.
reaching the upload limit is indicated by the following element (in red letters):

I have two problems:

  1. assertelementpresent does not stop the script. it jumps to the next loop and continues.
  2. !statusOK is true although the upload limit is not reached and the element is not visible.

what’s the problem here?

here it is:
{
“Command”: “store”,
“Target”: “2”,
“Value”: “!TIMEOUT_WAIT”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!statusOK”
},
{
“Command”: “assertElementPresent”,
“Target”: “xpath=/html/body/div[1]/div/div/div/div[2]/div/div/div/div/div[3]”,
“Value”: “”
},
{
“Command”: “gotoIf_v2”,
“Target”: “${!statusOK}==true”,
“Value”: “end”
},

{
“Command”: “label”,
“Target”: “end”,
“Value”: “”
}

AssertElementPresent detects element that is not visible

This is by design! This Selenium IDE command checks if the element is on the page, visible or not. What you need to use is wait for element visible or wait for element NOT visible.

You can do it like this:

  • set | true | !errorignore - do not stop if there is an error
  • waitforelementNOTvisible | xpath=... If the text is not yet visible, the command continues and !statusOK=true. If the element is visible and does not disappear within !timeout_wait time, then this command triggers a timeout error (thus we use !errorignore) and sets !statusOK=false
  • gotoIf_v2 | ${!statusOK}==true

Another option is to use visualVerify. It takes an image of the text as input.

Hi sounds logic. I already thought about that. Thank you very much!