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
ACTUALLY I AM WORKING IN THE DISTRIBUTION DOMAIN.MY COMPANY IS PROVIDING DISTRIBUTION SOFTWARE FOR PHARMA AND FMCG DISTRIBUTORS.HERE I AM USING QTP 9.2.HERE IN MY APPLICATION WHILE RECORDING ONE WINDOW APPEARS.IN THAT I CAN SELECT THE ITEM OR NO NEED TO SELECT.BUT WHILE RUNNING THE SAME SCRIPT THE WINDOW MAY NOT APPEAR OR APPEAR.HOW TO WRITE SCRIPT FOR THIS
What is object spy in quicktest professional?
Presently i am working on QTP 8.2 Version,i want to know features in 9.2 version, because i have not sufficient time to put the effort on the 9.2 version
if numbers are always changing write a script for that
hi guys we r working in office...we write some scripts..suddenly we have a work(5min only) in out side..what will do now,,,used to system shut down or log off or lock or sleep mode,switch use or hibernate?
how to write xml output check point bu useing descriptive programing .means without useing output check point
What is exact meaning of Database Checkpoint in QTP 9.2 and what are the different types of the database check points?
Define object spy ?
what is the mail use of frame work(with detail). architecture for keyword driven frame work
How is test case write?
Explain the difference between call to action and copy action?
In the website, the protocol has been changed http: to https what you will do? Tell me your approach?
Why is action split used by qtp?
What is Test Fusion Report in QTP?
hou can we use vb script in qtp could u tell me breafly