Answer Posted / raju
to get an HTML source code of Web page
HtmlCode = Browser("Google Labs").Page("Google Labs").Object.documentElement.outerHtml
' save HTML code to a local file
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.CreateTextFile("C:\HtmlCode.html", True, -1)
f.Write(HtmlCode)
f.Close()
' run tidy.exe to convert HTML to XHTML
Set oShell = CreateObject("Wscript.shell")
oShell.Run "C:\tidy.exe --doctype omit -asxhtml -m -n C:\HtmlCode.html", 1, True ' waits for tidy.exe to be finished
' create MSXML parser
Set objXML = CreateObject("MSXML2.DOMDocument.3.0")
objXML.Async = False
objXML.Load("C:\HtmlCode.html")
XPath = "//a" ' XPath query means to find all links
Set Links = objXML.SelectNodes(XPath)
Msgbox "Total links: " & Links.Length
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Why script error occur in between recording in qtp?
action contains public and private functions but do we resuable that action or not..If it is reusable How..plz tell me the ans
how can we do the frame work in qtp
Define virtual object?
What are the things(properties, and other details) will be recorded while recording an object using normal recording?
Can testing be done on the production system, or will a separate test system be required? How are browser caching, variations in browser option settings, dial-up connection variabilities, and real-world internet 'traffic congestion' problems to be accounted for in testing?
Discuss quicktest professional environment?
How would you export a script from one pc to another in qtp?
How to carry out bit map check points in QTP
what is Property......End Property loop? how to write sript for it in QTP
How many add-ins comes by default with qtp?
What are the different properties of an web object
How to creating an output value using quicktest professional?
Any body have QTP 9.5 licence key. please provide me at madhukar_dec30@yahoo.co.in
what is the difference between data driver & data driven and driver script?