Forum Discussion

aduddella's avatar
aduddella
Contributor
14 years ago

Get the Page source code into VB Script

Hi



Can anyone please provide me the VB Script code to get the html source code of a given webpage into a string or a object so that we can search the DOM structure





Thank you in advance





Regards

Anand

4 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Anand,



    Hm-m-m... To get the page as a string you may use the code from here: http://www.automatedqa.com/support/viewarticle/8999/?st=0

    Definitely, you know better what do you need and why, but personally I am not sure that manual analysis of the obtained html markup is a good idea, just because the actual page markup may be changed by included script functions, subsequent ajax responses, etc.

    Why not to load the page into the browser via TestComplete's ToURL() function (like at http://www.automatedqa.com/support/viewarticle/9043/) and use then TestComplete's functionality to drill-down the page structure?
  • Hi



    Thank you for quick response.I want the dom structure using the page object in test complete but the problem is that i can not see any html code in test complete at the page object level unless in the object browser i do into a table object of any inner objects.



    For my script to be independant i would want to get the dom structure using the page object in test complete and then perform dom related functions to manipulate rather than using in build test complete functions



    Is there a way you could suggest I can do this



    Thanks in advance



    Regards

    Anand
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Anand,



    > Is there a way you could suggest I can do this

    Doesn't the provided link (http://www.automatedqa.com/support/viewarticle/8999/?st=0) work for you?



    > For my script to be independant i would want to get the dom structure using the page object in test complete [...]

    What level of independency, independency of what and why do you need this?

    Don't you see the needed DOM objects in TestComplete Object Browser if you set project's properties to DOM (http://www.automatedqa.com/support/viewarticle/11940/) ?


  • Hi Alex



    Thank you for the link will check these links and get back to you



    Regards

    Anand