for example one window is there, the window contains how
many edit box's i want script? i know the script but that is
not exact answer....
The script is like this ..........

set a=description.creation()
a("Native class")="WinEdit"
b=window("Flight Reservation").childobject(a).count
msgbox b

Answer Posted / rajaputra

''''''''Try for this, It will give you all elements/items
count in the webpage'''''''''''''''''''''

url="http://my.naukri.com/manager/createacc2.php?othersrcp=5421&wExp=N"

If Browser("index:=0").Exist(1) then' If Browser is already
opened
a = Browser("index:=0").GetROProperty("hwnd")
Browser("hwnd:=" & a).Navigate(url)
Browser("hwnd:=" & a).Sync
wait(2)
Else' If Browser is not opened
SystemUtil.Run"IEXPLORE.exe"
a = Browser("index:=0").GetROProperty("hwnd")
Browser("hwnd:=" & a).Navigate(url)
Browser("hwnd:=" & a).Sync
wait(2)
End If

Set Editobj=Description.Create()'For WebEdits
Editobj("html tag").value="INPUT"
Editobj("type").value="text"

Set Butobj = Description.Create()'For Buttons
Butobj("html tag").value = "INPUT"
Butobj("type").value="submit"

Set Listobj=Description.Create()'For Web Lists
Listobj("html tag").value="SELECT"

Set Linkobj=Description.Create()'For Link
Linkobj("html tag").value="A"'

Set Checkboxobj=Description.Create()'For Checkboxes
Checkboxobj("html tag").value="INPUT"
Checkboxobj("type").value="checkbox"

Set Radioobj=Description.Create()'For Radio Buttons
Radioobj("type").value="radio"
Radioobj("html id").value="ctctype_i"


Set Edits = browser("hwnd:="
&a).Page("title:=.*").ChildObjects(Editobj)
Set Buttons = browser("hwnd:="
&a).Page("title:=.*").ChildObjects(Butobj)
Set Lists = browser("hwnd:="
&a).Page("title:=.*").ChildObjects(Listobj)
Set Links = browser("hwnd:="
&a).Page("title:=.*").ChildObjects(Linkobj)
Set Checks = browser("hwnd:="
&a).Page("title:=.*").ChildObjects(Checkboxobj)


Set Radios = browser("hwnd:="
&a).Page("title:=.*").ChildObjects(Radioobj)

msgbox "Total EditBoxes are : "&Edits.count
msgbox "Total Button are : "&Buttons.count
msgbox "Total Lists are : "&Lists.count
msgbox "Total Links are : "&Links.count
msgbox "Total checkBoxes are : "&Checks.count
'msgbox "Total RadioButtons are : "&r
msgbox "Total RadioButtons are : "&Radios.count+1


''''''If you have any doubts reply to this thread'''''''''''

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can UFT be connected to Quality Center? If ‘Yes’ brief the process or steps.

635


how can we preform retesting(DATA driven test) using function please gine the code for loginpage

2274


Could any one tell me "How can i recognize my cursor position using QTP 9.2" Give me a scripts for this

2062


Hi Frenz... I would like to take up the QTP certification . Can anyone tell me what is the procedure. n if anybody have the study materials pls fwd it to jkpunathil@gmail.com

1500


Explain calling sub procedure.

624






How to give a call to another action from one action?

629


When should I use smart identification?

604


How do you do batch testing in wr and is it possible to do in qtp, if so explain?

507


What is the use of defining a newobject in the object repository "Define New TestOject". How to use this further. If we define new testobject, how can it recognizes the objects properties of any application.

1504


Where you are storing your script?

633


Difference between test object and run time object?

592


Can we Test Welcome Screens and Process Images with QTP

1427


How can you close the second opened browser?

804


Write a script to verify font style and color of a windows object using descriptive programming

837


Hi Samrat, Thank u very much, what u said it is right.

1347