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 |
What are advantages of test automation?
what is the difference between Automation object model(AOM) and test object model(TOM)
How to swap two numbers by using parameter passing method byref in a fucntion and return the result to outside of the function?
explian qtp frame work and what is the use of it? what is the neceecity of this? explian detail?
The interviewer asked me when u recorded one application.object repository properties are saved with .tsr extention. in qtp expert view wherever mouse is there that snapshot displayed in active screen but some recored script lines are not displyed in actives screen y?
When The Low Level Recording is Used in QTP
hi, i am trying to capture "web element" names in a web page, and i written the code like this,, with Browser("title:=") with .page("") .webelement("htmltag:=...").getroproperty("innertext") end with end with //////////////////////////////////////////////////////////////////////////////////// QTP RETURN ERROR like this: " object's description matches more than one of the objects currently displayed in your application. Add additional properties to the object description in order to uniquely identify the object" ok fine , i need to search another property other than "index" i use all the properties like class,text,innerhtml,innertext,visible=true,x , y,abs x ,abs y...but qtp returns error ..... in this webpage index is difficult to find? how to solve
How can you handle exceptions in qtp?
hai there..this is chandu..i have a txt file which containing 1000 lines but at a time i want to retrieve 50 lines..after 50 lines i required to retrieve 51-100..like that i want...so could anybody help me in this...thanks in Advance..
I have two actions in my QTP test and two iterations in my DataSheet. I want to execute the Action 1 for the two iterations only after which i want to exceute the next Action2. How is this possible?
how to test a java project throughqtp?while testing a vb project we generally do vb scripting. but while testing java project do we use java script .plz some one can send me the manual for it my email roy_samata@yahoo.com thanks in advance
What is action? How many types of actions are there in qtp?