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

I am executing a batchfile.In one script on one Button i have inserted a checkpoint.It is in a loop,my checkpoint is going to fail sometimes.That failed results only I have to log in a file.How it's possible...pls give the solution for this?

6 Answers   Wipro,


What should we say if interviewer asks "What is ur project architecture?".......Can any one help me with clear information.?????????

0 Answers   Infotech,


What is the difference between Call to Action and Copy Action.?

2 Answers  


how can we test load time of an page in webtesting?

3 Answers   Ordain Solutions,


How To clear the AutoComplete?

1 Answers  






How can I generate customized logs in QTP ?

2 Answers   Ordain Solutions,


why the smart identification is not there in WinRunner

1 Answers   DigiTech,


assume i have few url link how will i dynamically call then using descriptive programming?

0 Answers   BirlaSoft,


How is test case write?

0 Answers  


What is Regular Expressions?

2 Answers  


How to connect to data base?

2 Answers  


Can u call winRunner scripts from QTP?

4 Answers  


Categories