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
How can we retrieve the Bug Ids which are open&Reopen in status through QTP scrit?Please find the script which i tried... Dim objBugFactory, objBug Dim BugId Set TDConnection = QCUtil.TDConnection Set objBug = TDConnection.BugFactory If QCUtil.IsConnected then Reporter.ReportEvent 0, "Connected", "Connected to server: " + QCUtil.TDConnection.ServerName + chr (13) +"Project: " + QCUtil.TDConnection.ProjectName + chr (13) + "Domain: " + QCUtil.TDConnection.DomainName Reporter.ReportEvent 0, "Current time on server is","==>" & TDConnection.ServerTime Else Reporter.ReportEvent 1, "Not connected", "Not connected to Quality Center" End If If mybug.Status="Open" Then BugId=mybug.DefectId MsgBox BugId End If 'OR**********************************--------------------- -----********************************** If Bug_Fields("BG_STATUS").Value ="Open" Or "Re Open"Then BugId=Bug_Fields("BG_BUG_ID").Value MsgBox BugId End If
give me the code to save all messages of inbox of gmail into a folder and notepad
What is the pros and cons between QTP and Rational Robot
Explain runtime dynamic settings?
Whar are the challenges do we face while testing web based applications using the automation tool QTP or any??
What are the recording modes in qtp?
Create flight reservation login descriptive programing (Condition: Remove the value and substitute with a variable, and then call the validation from Excel) Plz help me....... very urgent.........
Give me some real time point of way where exactly we can conduct audits?
What are the Disadvantages of shared object repository?
Hi all Can u give me the link where we can download full version of qtp my mail id is karthic.venkitapathi@gmail.com
How many lines of code in each script of QTP?
How to analyzing test results using quicktest professional?
what function you write to do database testing with the help of qtp?
How will you test a keyboard?
What is reusable action?