GeekInterview.com
Series: Subject: Topic:
Question: 175 of 1523

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?
Asked by: geekarijit | Member Since Jan-2007 | Asked on: Sep 29th, 2008

View all questions by geekarijit

Editorial / Best Answer

Answered by: researchingmiddleware

View all answers by researchingmiddleware

Member Since Oct-2008 | Answered On : 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

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

Yes  6 Users have rated as useful.
  
Login to rate this answer.
priyankvyas

Answered On : Feb 14th, 2009

View all answers by priyankvyas

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.

Yes  2 Users have rated as useful.
  
Login to rate this answer.
dabas_rajender

Answered On : Jun 28th, 2010

View all answers by dabas_rajender

We can use the descriptive programming for identifying the 6th checkbox from a bunch of checkboxes on a page.Dim obj_ChkDescSet obj_ChkDesc=Description.Createobj_ChkDesc(“html tag”).value = “INPUT”obj_ChkDesc(“type”).value = “checkbox”Dim allCheckboxesSet 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'

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.