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

I have some real time based question.. 1.what are the challenges you have faced in your current project. 2.what are the bugs you found in your current project. 3.what are the strategies you follow to convert manual test cases into automation test cases. 4.how QTP identify two different browsers. 5. When you create a function library and share object repository what are the problems you have faced 6. How to solve the tool tip problem 7.what are the interesting bug you have found in your current project. 8.what is your daily work as a automation test engg. 9. how to create a weekly status report. 10. how many test cases you write,review and execute per day. 11.what are the uses of SQL in automation. 12.How to retrieve the data in html through vb script. 13.If application is very slow how to test the application in qtp.

0 Answers   Cap Gemini, TCS,


I want to know how to execute the descriptive programming in qtp for the webedit object which does not contain attached text property. but i have checked it with name and html id property. Even though it is not executing. it is giving error in object's physical description.

2 Answers  


can anyone please tell me what are all the shortcut keys used for qtp9.2? Thanks in advance..i expect ur valuable reply that help us our team???

0 Answers  


Can anybody give the code for ALL DATATABLE METHODS)(ex: datatable.getrowcount, datatable.getsheet etc....) and ALL DATABASE COMMANDS (like .getcelldata, which are used to retrieve data from a database and from a webtable)with examples.

1 Answers   Accenture,


What is an optional step in qtp ?

0 Answers  






How to measure transaction time through VBScript without using start and end transaction points?

0 Answers  


How can i check all the button that are enabled in a widnows based application ? What script should i write for this ?

1 Answers  


hi all can any body explain how to write the script for finding the mandatory fields which are having [red Astrik sign (*)]

0 Answers   Accenture,


I have multiple radio buttons i need to select a radio buton and i dont want to hard code i have a generic function for it there i have used select#0 so it selects first radio button but for other script i want to select the 4th radio button how i can make it still more generic

4 Answers   Accenture, Acentia, LM,


Why we have to import data from excel sheet to data table?becoz v can directly use test data directly from xl know. can u all pls explain me clearly

1 Answers  


what is the another name for blackbox testing?

7 Answers  


How to connect QTP to Testdirector

4 Answers   BirlaSoft, Polaris,


Categories