HOW TO COUNT NUMBER OF ITEMS PRESENT IN WEB LIST

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


Please Help Members By Posting Answers For Below Questions

Client is able to provide budget..he want you to choose the automation tool for the web application? which one you will select ? QTP or Selenium ? what are the reasons?

1499


how can i pass a "cript"as a parameter in to a function

1684


What is the meaning Work bench?

1979


How to add synchronisation points in qtp?

774


There is an excel file of 1 to 100 sheets how you will iterate through it?

776


What is meant by Output Value in UFT?

802


in qtp if we record a object and we record the object using virtual wizard then by which way the object is recognized that means recorded

1745


www.icici.com after this home page wll came, in this page what r the items we r going to test for manual and what the element we r test for QTP... explian clearly with example

1746


I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.

1772


How to define array in qtp?

780


Brief the process of testing with UFT?

820


What is synchronization? What are the ways you can synchronize?

898


how to idetfy which test cases are automated?who will deside that plz tell me

1773


What are the key points to create a framework in QTP for oracle forms?

2023


What is difference between shared and local object repository?

824