Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



for example one window is there, the window contains how many edit box's i want script? i know..

Answer / saravanaraja

This Code is working Perfect:

Set desc=Description.Create()
desc("micclass").Value="WebEdit"
Set Edit=Browser("Title:=.*").Page("Title:=.*").ChildObjects
(desc)
msgbox Edit.Count

Is This Answer Correct ?    2 Yes 0 No

for example one window is there, the window contains how many edit box's i want script? i know..

Answer / softwaretester4u

use this example for windows alos
Step1: Set Objects = Browser("BrowserName").Page
("PageName").ChildObjects

Step2: Objectcount = Objects.count
Linkcount = 0
Step3: For i = 1 to Objectcount-1

Link = Objects(i).GetROProperty("micclass")
If Link = "Link" Then
Linkcount = Linkcount+1
msgbox Linkcount
End If
Next
msgbox Linkcount ' It show total number links

Set oDesc = Description.Create()
oDesc("micclass").Value = "Link"
Set Lists = Browser("Google").Page("Google").ChildObjects
(oDesc)
NumberOfLists = Lists.Count()
linkcnt = 0
For i = 0 To NumberOfLists - 1
linkcnt = linkcnt+1

Next
msgbox linkcnt

Is This Answer Correct ?    1 Yes 0 No

for example one window is there, the window contains how many edit box's i want script? i know..

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

More QTP Interview Questions

How to Analyze the Checpoint results by Text/Text Area Checkpoint?

1 Answers  


How do you send email with attachment from outlook using qtp ?

0 Answers  


In Developer view it is a high priority defect & in tester view it is a low severity defect what is that how to define with an example

2 Answers   Broadridge,


Explain about Checking Bitmaps?

1 Answers   Crea,


How Does Run time data (Parameterization) is handled in QTP?

4 Answers   IBM,


how to download mercury qtp9.2 ny internet ?

0 Answers  


i did B.Tech cse and i secured 76%. instead of siting at home ... i would like to do some course. can u suggest me in this.

1 Answers  


Output values? i want a practical example

0 Answers  


Explain advantages and disadvantages kdf?

0 Answers  


What is meant by Step generator?what is the use of this? we have 3 steps know there what r all those.? can u all pls give me clear idea of this

0 Answers  


Our company is having a windows client server application developed in vb.net. so there is a treeview and i am not in a position to record the click events in QTP. so kindly help. Vivek

0 Answers  


what are the settings to be done to make the recovery scenario created for one test to be used bye all the other tests. please tell me recovery scenario process in detail.

1 Answers  


Categories