Can Any One Write How to Write the Script for Child Objects

Answers were Sorted based on User's Feedback



Can Any One Write How to Write the Script for Child Objects..

Answer / deven

Dim obj_ChkDesc

Set obj_ChkDesc=Description.Create

obj_ChkDesc(“html tag”).value = “INPUT”

obj_ChkDesc(“type”).value = “checkbox”

Dim allCheckboxes, singleCheckBox

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

For each singleCheckBox in allCheckboxes
singleCheckBox.Set “ON” Next

Note: It will check all the check boxes on the page with
Child object

Is This Answer Correct ?    0 Yes 0 No

Can Any One Write How to Write the Script for Child Objects..

Answer / sandeepguttikonda

Child Objects are used to perform the operations on similar
data.

Example: to get the total number of link in a Page:

And we can perform this by using the below code:

/* Creating the description object*/
Set oDescFrame = Description.Create
oDescFrame("micclass").Value = "links"

Set Links_Count = Browser("name:="&Browsername).page
("title:="&Pagetitle).ChildObjects(oDescFrame)

Msgbox &Links_count.count

This will display the total number of links in a page.

Please let me know if you need any further info.

Thanks.

Regards,
Sandeep Guttikonda

Is This Answer Correct ?    0 Yes 1 No

Can Any One Write How to Write the Script for Child Objects..

Answer / manohar

Sorry , Actuvally i want the Example script for Using the
Child objects.
Iam not sure of using the Child Objects . I know the script
that which you had written for Fikle system Objects.

Is This Answer Correct ?    0 Yes 2 No

Can Any One Write How to Write the Script for Child Objects..

Answer / kanda

Here i am giving one example to create New file in New
Folder and to write a "Hello World" in that file

File System Object Model
----------------------------
set fso =createobject("scripting.filesystemobject")
set newfolder = fso.createfolder("C:\QTP",True)
Set newfile = newfolder.createtextfile("C:\QTP\Test1",True)
newfile.writeline("Hello World")
newfile.close


Try with tis..I hope it will work

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More QTP Interview Questions

how can i call an external action,which is not added external action of an action?

2 Answers   Ordain Solutions,


I have java based application on my computer. Can I install QTP on it? What are system requirements for installing QTP?

3 Answers  


I am having trouble understanding #1 how to paramaterize a userid and password that I need to call in about 25 existing scripts. I need to know how to Create a Reuseable action for 25 existing scripts that will call the exact same userid and password? I need to know how to create a Reuseable action and then have it called by existing scripts being run in a batch.

2 Answers  


How to handle "Java Runtime error" popup window in the web application ? Sometimes the application throws the error repeatedly... Is there any browser setting available to disable the error ?

2 Answers   TCS,


how many types of actions r there? what r they? explain? pls give any one answer?

3 Answers   IBM,






when u script reveiwing in which area u more concentrates?

0 Answers   IBM,


what is the difference between DP and keyword driven framework?

1 Answers  


We have 10 page.In first page we 2 popup and next page we 3 popup window......(windows name is different)how can we handle the all the popups without using recovery scenario

1 Answers   HK, TCS,


What are the types of object repositories? Which one is you are using?

0 Answers  


can any one tell me how to select some text.i need the script for that

1 Answers  


what is the difference between DATA TABLE and DATA SET?

2 Answers   Accenture,


I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format, if possible, kinldy mail PDF file to my mail-ID: ramakrishna908@gmail.com Regards, krishna.

0 Answers  


Categories