Determine a web page element which contains exact text

How can I determine a web page element which contains exact text?

E

Expert

Verified

TestComplete gives you with access to ways and properties of web page elements, therefore you can search all web page tools and get the desired text within the element properties. To check the search, you can utilize the Page object’s Find Method. Such method uses three parameters as: KeyValue, Page.NativeWebObject.Find(PropertyName and TagName.

  • PropertyName:  It is name of the property, that value is checked through the method. Classically the element’s text is available through the innerText or innerHTML property.
  • KeyValue: It is the sought-for text (we can employ the * and ? wildcards to identify the search masks).
  • TagName - Such parameter is optional. You can use thsi to identify tag names which you would like to search in. See that since the name of the Find method coincides along with the name of the Find method added to each tested object by TestComplete, the Page object’s method resides within the NativeWebObject namespace, it is, in your script you must call Page.NativeWebObject.Find rather than Page.Find. For code illustrates, see the Searching for Web Page Element Containing Specific Text blog upon our AQCommunity site or the “Searching for the Element having the Desired Text” assist topic.

   Related Questions in Programming Languages

©TutorsGlobe All rights reserved 2022-2023.