How to count no of edit boxes on the page?

Answer Posted / jaivir singh

Hi All,

Please use below DP to Counts(Links,web Button and WebEdit Box)of any web applications.simply you need to copy from here and past in QTP.



SystemUtil.Run "iexplore.exe","https://accounts.google.com/ServiceLogin?hl=en&continue=https://www.google.co.in/%3Fgws_rd%3Dcr%26ei%3De_HIUsCCNcqOrgfT0oCAAQ"
wait 10
Set Desc = Description.Create
Desc("micclass").Value = "WebEdit"
Set Edits = Browser("creationTime:=0").Page("micclass:=Page").ChildObjects(Desc)
MsgBox "Number of Edits: " & Edits.Count

Set LinkObj=Description.Create
LinkObj("micclass").Value = "Link"
Set Links = Browser("creationTime:=0").Page("micclass:=Page").ChildObjects(Link)
MsgBox "Number of Links: " & Links.Count

Set btns=Description.Create
btns("micclass").value="WebButton"
Set dlg=Description.Create
dlg("name").value="signIn"
Set ocollection = Browser("creationTime:=0").Page("micclass:=Page").ChildObjects(btns)
msgbox ocollection.count

Set ImageObj=Description.Create
ImageObj("micclass").value="Image"
Set dlg=Description.Create
dlg("name").value="Image"
Set oImage = Browser("creationTime:=0").Page("micclass:=Page").ChildObjects(Image)
msgbox oImage.count

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there any relation between Keyword Driven Framework and Recording modes provided in QTP( whether Recording modes are applied on keyword driven framework or not?)

1454


What is the difference between a Function and Action in QTP?

590


Hi Friends, How many types of Data Bases available in market... What is the diff. while using Syabase and Oracle in a Project... ? and what is the main diff. of Syabase and Oracle databases... ? Thanx in advance..

1514


What is a quick test professional?

630


How will you find the current time of the remote machine using QTP script?

597






Hi! Using Descriptive Programming How do we get Parent object for an object by writing script(DP). Say, i want to get a parent object for a "Link" in a web page by writing script in Descriptive Programming.

2103


How to save your test using quicktest professional (qtp)?

599


What is the limitation to XML Checkpoints?

1602


Why is action split used by qtp?

561


What is the difference in the global and action sheet in qtp?

570


Explain runtime dynamic settings?

2026


hi in real time who will execute the qtp test scripts? my faculty said, in a companty automation testers are written the test scripts and manual testers are execute the test scripts...IS IT RIGHT OR NOT?

2803


Hi we are using QTP9.0 for Seibel Application and this seibel application will give you a popup messagebox which is of web , so qtp takes 3 mins to recognize the messagebox and to click on it , we have more number of messageboxes like this . please suggest me some solution

1667


In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.

1529


I am a newbie to QTP / Automation testing. I want to develop a script that creates a data file automatically with proper headings using VBScript in QTP.

1586