Skip to content

assertText (UI Automation - Interrogation)

Compatible with:
  • Purpose
  • Generated from getText(locator) 
  • This command is used to verify if the text of an element matches the pattern given in the Value. This works for any element that contains text.
  • This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.
  • Syntax
  • assertText(locator, pattern)
  • Target
  • locator
  • Value
  • pattern
  • Return Value
  • Returns true if the text matches, false otherwise.
 

Feedback and Knowledge Base