How to make QTP understand the difference with same type of objects

Suppose there are 10 of check boxes in a page and i have to choose the 6th one, how to do that through script?

Questions by geekarijit

Editorial / Best Answer

researchingmiddleware  

  • Member Since Oct-2008 | Oct 8th, 2008


Use the Ordinal identifiers (index) property...each of the objects will have a different index value

Showing Answers 1 - 3 of 3 Answers

priyankvyas

  • Feb 14th, 2009
 

QTP identifies the object in following manner-


1) First with mandatory and assistive property. If these are not sufficient
then "Ordinal Identifier"
2) By using "Smart Identification".


In your case you have different object of same type. First they have
different names, so object will be identified easily.
If there are more than one object with the same name than use "Ordinal
Identifier - Index".
With "Index" property object will be identified.

We can use the descriptive programming for identifying the 6th checkbox from a bunch of checkboxes on a page.

Dim obj_ChkDesc

Set obj_ChkDesc=Description.Create
obj_ChkDesc(“html tag”).value = “INPUT”
obj_ChkDesc(“type”).value = “checkbox”

Dim allCheckboxes

Set allCheckboxes = Browse(“Browser”).Page(“Page”).ChildObjects(obj_ChkDesc)

allCheckboxes(5).Set “ON”

As index value start from the value '0', so 6th object is having index value '5'

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions