If locating the element throws an exception

Check out the screenshot guide below!

For any other exception

  • Mark test step status as fail and exit the element location loop

If the exception indicates that the element could not be found

  • If time elapsed is less than timeout – then try this waterfall approach to locating the element
    • Using relative path
    • Using absolute path
    • Using alternate path captured during automation
    • Locate by Searching on page by text
    • Locate using unique name and path
    • Locate using approximation method
      • Figure out element type from keyword
      • Extract the last tag segment from the XPath to search for
      • Walk up the dom structure trying to locate the element
      • Get element attributes from the outer html that was recorded while automating
      • Search for the last tag segment
      • For every found element – compare the attributes with the recorded outerhtml attributes
      • Repeat till either element located or root is reached
  • If element is still not found using all of the above approaches and time has not elapsed – then retry the whole locating elements process from xvii

Have other questions? Access our full knowledge base!

Verified by MonsterInsights