How to count no of edit boxes on the page?

Answers were Sorted based on User's Feedback



How to count no of edit boxes on the page?..

Answer / babu

Set oDesc = Description.Create()
oDesc("micclass").Value = "Webedit"
Set Lists=Browser("Login").Page("Application").ChildObjects
(oDesc)
NumberOfLists = Lists.Count()
msgbox NumberOfLists

By using above statements you can find the count for no of
edit boxes in a page.

Correct me if i am wrong.

Is This Answer Correct ?    25 Yes 3 No

How to count no of edit boxes on the page?..

Answer / guru

'Count the Number of Edit box

Set Desc = Description.Create()
Desc("micclass").Value = "WebEdit"
Set EditBoxes = Browser("").Page("").ChildObjects(Desc)
MsgBox "Number of Edits: " & EditBoxes.Count

By using above code you can find the count for no of
edit boxes in a page.

Correct me if i am wrong.

Is This Answer Correct ?    5 Yes 2 No

How to count no of edit boxes on the page?..

Answer / 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

More QTP Interview Questions

when to start the automation?

0 Answers   Accenture,


How to create a Runtime property for an object in QTP?

6 Answers  


i need qtp tutorial. pls send it to sridhar.k151@g mail.com

0 Answers  


I have a string "Redfort is in Delhi" how do u write vbscript for " Delhi in is Redfort"

4 Answers  


Give me some real time point of way where exactly we can conduct audits?

0 Answers   CTS,






How to use the object spy in quicktest professional 8.0 version?

0 Answers  


Is the qtp course will help to create a virtual object?

0 Answers  


For QTP Test Engineer, What is his contribution to the Project? Means, As as automation test engineer what is his role in the current project?

0 Answers   V2 Solutions,


How to test results for qtp ?

0 Answers  


what version of test director supports the QTP? does testdirector supports the QTP9.0?

1 Answers  


Why do you create a text checkpoint on a Web application? What is the purpose of the Close method?

0 Answers  


3.How to record a word doc using qtp i.e open a word doc,type something and save the doc can someone send me the code.

5 Answers  


Categories