Forum Discussion

nisgupta's avatar
nisgupta
Valued Contributor
4 years ago

Testcomplete do not recognize the text on web page and browser title

We are trying to verify the browsertitle and message on the web page but Testcomplete do not recognize it . Attach the screenshot.

 

 

We are using

Sys.Browser("*").Page("*").contentDocument.body;   For the text on the web page but it return empty string

 

We are using for browser title

Sys.Browser("*").Page("*").contentDocument.title  but it returns empty string.

 

 

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    You're wildcarding an AWFUL lot in your identification of the page.  If you have any other browser open to any other page in your system, you will run into a problem with unique identification.  What happens when you replace the wildcards with the actual browser name and page URL that you're attempting to access?  Does it work better for you then?

     

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    In addition to Robert's reply: any real reason to use contentDocument property but not the properties provided by TestComplete?

     

    Also, can you provide a code snippet (along with the navigation to the page) that returns empty values?

     

    • nisgupta's avatar
      nisgupta
      Valued Contributor

      tristaanogre 

       

      I am killing all the browser process before the script invoke the application. 

       

      tristaanogre 

      Yes Testcomplete do not recognize the object that is why we cannot use the properties. One thing I noted 

      Under the Web testing when I check the option "Use XPath and CSS selectors for web objects(required for cross-platform web tests) then do the object spy then object spy highligh the text  as attached in the screenshot.