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 we do database testing with qtp using descriptive programming?

22 Answers   Nutrins, Rohit Technologies, Symphony, Syntel, TCS,


Why we have to split actions in a test?

4 Answers  


What is the difference between QTP 8.2 and QTP 9.2 ?

4 Answers   IBM, Infotech,


how to use command prompt using qtp?

8 Answers   HCL,


hi i have one doubt i have 4 yrs exp in testing and iam working one mnc in north but i have completed my degree correspodene is the companies are accept in south side some people are tellig they won't agree but i need correct answer plz let me know which companies are taking and not taking thanks in advance

8 Answers  






how do u create new test sets in TD

1 Answers  


How to Analyze the Checpoint results by Text/Text Area Checkpoint?

1 Answers  


i am testing an online shopping application.I CLICK on a link "ADD TO CART" of that application a "new page" is open and then click on any object of that "new page". after that when i run this SCRIPT then on this "new page" QTP always shows error of "OBJECT NOT FOUND". How i solve this problem ?

4 Answers  


Hi all can any one give me roles and responsibilities for QTP (not WINRUNNER)

0 Answers   Autodesk, EDS, Wipro,


How to work with multiple browsers when opened in the window, write the script for it

2 Answers   Verizon,


Got job with 3 years fake Experience

1 Answers   MNC,


hi, FOR 3+ QTP INTERVIEW, FOR EXAMPLE WE PUT ONLINE BANKING SYSTEM PROJECT IN OUR RESUME, IN PROJECT MANAGER ROUND...WHAT R THE MAJOR QUESTIONS ARE ASKED IN P.M? PLS TELL ME ATLEAST 10 QUESTIONS?.....AND IF POSSIBLE POST ANSWERS ALSO....

0 Answers  


Categories