How will you send values to a cell in a webtable using QTP?

Answers were Sorted based on User's Feedback



How will you send values to a cell in a webtable using QTP?..

Answer / amarendra kothuru

For WebTable object, you can retreive the cell data but
can't set any value directly.

To retreive data.
val = Browser().Page().WebTable().GetCellData(row,column)

To set the value.
If you want to set any value on cell, you can do it on its
child objects.
So make sure what is the child object of that cell i.e.
either WebEdit or WebCheckBox or WebRadioButton etc...

Using the method, you can set the value to that child objet.

Using ChildItem method, you can fetch the child object of
the cell.
Browser().Page().WebTable().ChildItem
(row,col,ChildObjClassname,index of the child
object).Set "abcd"

or

Set ChildObj = Browser().Page().WebTable().ChildItem
(row,col,ChildObjClassname,index of the child object)
ChildObj.Set "abcd"

E.g.
Set ChildObj = Browser("ab").Page("cd").WebTable
("de").ChildItem(row,col,WebEdit,0)
ChildObj.Set "abcd"

If the cell has more than multiple similar child objects,
then you need to take care of the object index.

Is This Answer Correct ?    38 Yes 6 No

How will you send values to a cell in a webtable using QTP?..

Answer / rayudu

Using
setcelldata(row,Col,"Data")

Is This Answer Correct ?    6 Yes 28 No

Post New Answer

More QTP Interview Questions

What is AUT in object reposity in QTP? Why we use it in Object repository???What is full form???????

6 Answers  


what are the environment variables,how do you use them. give an example.

3 Answers   Polaris,


Suppose Object name was changed in the application in the second build.I have just modified the name in the Object repository as changes in the Application. Is it possible to accure changes in the script accordingly? If so Suppose I am calling the script through function, Will the changes affect in the script(which is in the function)automatically? If not affected, tell me the solution,How to handle this. How should I change the object property name while using functions

4 Answers   Livetek,


How to connect to a database?

0 Answers  


In qtp,how to interact tool & application build?

1 Answers  


HOW TO DO THE BATCH TESTING USING QTP?

2 Answers   Ordain Solutions,


Which environments does qtp support?

0 Answers  


Wht are the BY default Add-ins in QTP 9.2 version and what all are differences between 8.2 and 9.2

2 Answers   Siemens,


How many types of recording modes in qtp?

0 Answers  


How do we retrieve the content from a text box in a web page

2 Answers  


i don't have any experience in qtp? Can u please tell me What work i have to do?

4 Answers  


Can I use datatable of Action1 in the Action2.

2 Answers   IBM,


Categories