How Can I Find A Web Page Element That Contains Specific Text

How Can I Find A Web Page Element That Contains Specific Text


  • 6 Dec, 2011

    estComplete provides you with access to methods and properties of web page elements, so you can search all web page elements and find the desired text in the element properties. To perform the search, you can use the Page object?s Find method. This method uses three parameters: Page.NativeWebObject.Find(PropertyName, KeyValue, TagName) ► PropertyName - Name of the property, whose value is checked by the method. Typically, the element?s text is accessible through the innerHTML or innerText property. ► KeyValue - The sought-for text (you can use the * and ? wildcards to specify the search masks). ► TagName - This parameter is optional. You can use it to specify tag names that you would like to search in. Note that since the name of the Find method coincides with the name of the Find method added to all tested objects by TestComplete, the Page object?s method resides in the NativeWebObject namespace, that is, in your script you should call Page.NativeWebObject.Find rather than Page.Find. For code examples, see the Searching for Web Page Element Containing Specific Text blog on our AQCommunity site or the ?Searching for the Element Containing the Desired Text? help topic.

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.