Forum Discussion

fujunxu's avatar
fujunxu
Contributor
12 years ago
Solved

how to read HTML files in TC?

I need to read HTML files in TC(I can read it as plain text file but I wonder if TC provide some easy way to read HTML files).  But I only found how to read XML in TC. Does anyone have some example or tutorial for reading html files in TC ? 



Thanks a lot!

7 Replies

  • Hi Aaron,

     


    The answers may be different - what do you want to do with the HTML file in your test?


     

  • AlexKaras's avatar
    AlexKaras
    Community Hero
    Hi Aaron,



    You can open html file in the browser and then work with it as with regular web page using the means provided by TestComplete for web testing.
  • AlexKaras's avatar
    AlexKaras
    Community Hero
    Hi Aaron,



    Also, in addition to Tanya's reply, you may consider regular expressions to be used.



    (As Tanya mentioned earlier - there may be a lot of different approaches depending on what exactly you need to do :) )
  • Hi,  Alex,



    Thanks.  That will be a work around for me. 



    Aaron
  • Hi Tanya,



    The HTML file is one of the output files for my testing.  I need to read it and retrieve some information.  If there is any easy way to read the HTML that will be great.



    Thanks for your help.



    Aaron
  • Hi Tanya,  Alex,



    Thanks.  I did tried the XML approach but it looks like some of the tag was not recognized.  I  will read them as text file.   Thanks again for your help.



    Aaron