Timeout reached on verifyElementPresent (not assertElementPresent)

I intermittently recieve an error and my macro stops on verifyElementPresent commands. If the element is not present it should still continue with the code. I’m not using assertElementPresent.

[error] [Line 202]: timeout reached when looking for element ‘xpath=//*[@title=“Sample Median”]’

Yes, it should continue. What does the log say? Error or warning?

I get the same issue

[error] [Line 7] timeout reached when looking for element ‘id=divApptTypeInfo0’

have 5.9.5 installed

Do you have a test case for us? In my test it works, and I get only a warning as expected:

{
  "Name": "test e",
  "CreationDate": "2021-2-2",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://forum.ui.vision/t/timeout-reached-on-verifyelementpresent-not-assertelementpresent/6392",
      "Value": ""
    },
    {
      "Command": "comment",
      "Target": "click // linkText=dNd2LtphJE",
      "Value": ""
    },
    {
      "Command": "verifyElementPresent",
      "Target": "linkText=dNd2LtphJEXXXXXX",
      "Value": ""
    }
  ]
}

same as the pic

  {
      "Command": "open",
      "Target": "https://www.gianteagle.com/covidvaccine",
      "Value": ""
    },
    {
      "Command": "clickAndWait",
      "Target": "xpath=/html/body/div[2]/div/section/div/div/div[3]/div/a/div/img",
      "Value": ""
    },
    {
      "Command": "pause",
      "Target": "5000",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "true",
      "Value": "!statusOK"
    },
    {
      "Command": "verifyElementPresent",
      "Target": "id=divApptTypeInfo0",
      "Value": ""
    },
    {
      "Command": "if_v2",
      "Target": "${!statusOK} == true",
      "Value": ""
    },
    {
      "Command": "open",
      "Target": "https://www.google.com/",
      "Value": ""
    },

Thanks for the test case. => All works fine for me, see the video below.

The screencast also shows that !statusOK is set to false, because verifyElementPresent fails (= element not found). Does it work differently on your machine?

I am getting this as well now when combined with a times function. If I enter in the XPath as normal it works, enter in the XPath with the ${!times} and it returns as required, then it gives an error. Appears to be that if it starts on a number reference that doesn’t exist, it then timeouts.

image (1)

{
  "Command": "times",
  "Target": "10",
  "Value": "",
  "Description": "xero"
},
{
  "Command": "verifyElementPresent",
  "Target": "xpath=/html/body/div[2]/form/div/div[1]/div[2]/div[1]/div[3]/div[${!times}]/div[3]/div[2]/div/div[2]/div/a",
  "Value": "",
  "Description": "xero"
},
{
  "Command": "if_v2",
  "Target": "${!LastCommandOk} == false",
  "Value": "if possible matches dont exist",
  "Description": ""
},
{
  "Command": "click",
  "Target": "/html/body/div[2]/form/div/div[1]/div[2]/div[1]/div[3]/div[div[${!times}]/div[2]/a[1]",
  "Value": "",
  "Description": "reconcile"
},
{
  "Command": "end",
  "Target": "",
  "Value": "",
  "Description": ""
},
{
  "Command": "end",
  "Target": "",
  "Value": "",
  "Description": ""
}

]
}

If required

seems to be an issue if you restart/run from the middle of a macro, but not from the beginning.

Hi Admin, UI vision is amazing however i am having troubling locating a setting. So in my scripts i always get a warning when element can’t be found and it picks the secondary locator with the following warning.
Element found with secondary locator “xpath=//select”… this is working how i want it to, however when my collegues run the same script they get a wait timeout error. How do i change their settings to get a warnings like i do instead of a error.