How will u find that how many List boxes( and check boxes)
are present in one particular window
Answers were Sorted based on User's Feedback
Hi,
try this code...
set odesc = discription.create
odesc("Class Name").value ="WinCheckBox"
odesc("native class").value="Button"
set checkboxcount= window("<window name>").childobjects
(odesc)
counts=checkboxcount.count
msgbox counts
u will get number in msgbox.
please ping me if there is any feedback.
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / nanda
Hi,
try this code... i did some spelling mistake in above
answer..pls change that..
discription=description
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / akila
hi,
i tried this script. it's working fine but not giving
appropriate checkbox in the application
| Is This Answer Correct ? | 1 Yes | 0 No |
HI Every bodey,---
Any object present in the page is known as childobject.
Ex:-Link,Web Edit,Check Box,Web button,List box,etc...
If u want to coun the Listboxes (or)Check boxes you can
write below script.
---------CODE----------
set ochbox=description.create
ochbox("micclass").value="checkbox"
set chobj=Browser().Page().childobjects(ochbox)
n=chobj.count
msgbox n '(here you can get how many check boxes there in a
page)
for i=o to n-1
val1=chobj(i).getroproperty("innertext","name")
msgbox val1
next
-----------End---------
In the same way we can find Links,Webbuttons,Listboxes,etc..
Any doubts----mail to----mskalyan.smile@gmail.com
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / venkatesh
Set oPageObject = Browser("browsername").Page
("pagename").Object
Set oTableObject = oPageObject.getElementsByTagName
("list")
iTotalTbl = oTableObject.length
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ramya
'Counting total number of lists
Set Odesc= Description.Create
Odesc("htmltag").value= Input
Set linkcollection= Browser("").page("").childobjects(Odesc)
Itemcount=linkcollection.count()
msgbox Itemcount
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / softwaretester4u
very intresting question,but i never found in QTP my
experience .pls tell me if any one knows
| Is This Answer Correct ? | 0 Yes | 2 No |
any one could you explain the following code with example: intFieldItemsCnt =CInt(GetProperty(Browser ("Browsername").Page("Pagename").Weblist ("weblistname"),"items count")) msgbox intFieldItemsCnt
I know the Basic QTP. But I wanted to learn descriptive programming in QTP. Without Object Repository how we can develop a script? I wanted to do one real time project using QTP. If you know this type of training is available in pune then let me know the address.
Can any body explain me how to prepare QTP frame work with an example?? alexander.gdk@gmail.com
whow much strong on VB and C?
I wnnt to learn about QTP Automation Framework,please give URL Address to get more information about AFW.
Why to use descriptive programming?
write a function to read the items from Combobox of Flight Reservation application and save in excel.
hi all can any body explain how to write the script for finding the mandatory fields which are having [red Astrik sign (*)]
I hav installed QTP8.2, im working on webapplication, while running the script giving error msg like "QTPro.exe generated errors and will be closed by windows. You will restart the program. An error log is being created". Pls anybody what is the problem, what i have to do for this? Thanks...
Explain about Table and DB Checkpoints?
I have to pass all the test cases into gmail userid and password using functions please give me code thanks have anice and greate day
we r conduction testing on a project USING QTP, regarding that project the object repository is full ? Till that project having objects that r not recognised by repository, then what wil you do? How we wil recogine remailning objects? Is it possible to maintain another shared(or)peraction repository? what is the maximum capcity of object repository? How the technical people decide this much object repository is enoughf for this project?