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 to test whether the navigation i.e. from one page to another is working r not using QTP for web based application

1 Answers  


Hi How to retrieve data from web element line by line?

0 Answers  


What issues come up in test automation, and how do you manage them?

0 Answers  


How to find if given number is prime or not

1 Answers  


what is the exact testing process in qtp plz explin ?

2 Answers  


how can i sent QTP results to the Html, notefile ,xl file give me the code using g mail login page

0 Answers  


I want to know can we integrate visual source safe tool with QTP and QC for our version controlling process? WE know QTP and QC 10.0 version is having the version control inbuilt in it but I want to know the merits and demerits of the inbuilt version control tool and the visual source safe tool using QTP and QC.

0 Answers   Wipro,


What are the types of Object Repository’s in QTP?

2 Answers   Crea,


What is the difference between Global and Local Data Sheets?

1 Answers  


What are main panes available in qtp test browser?

0 Answers  


What are the limitations in using Virtual objects?

1 Answers   ITC Infotech,


Differences between QTP & Winrunner?

2 Answers   Crea,


Categories