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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I import environment from a file on disk?

540


when I was doing the web testing with QTP using with standard checkpoint the Object selection -checkpoint properties dialog box not displaying pages and links hierarchical order. Could you please tell me. thanks

1736


what is the latest version of QTP? Main difference between 9.2 and 10 version

1556


Can anybody post some real time scenario in qtp? please its very urgent.

1805


Give me detailed theritical explanation about keyword driven, hybrid framework, environment variables, hybrid frame work

1446






give me the code to save all messages of inbox of gmail into a folder and notepad

1625


how will you load the test cases in ddt?

1598


How may types of defects identify application or your currently working application?pls give me answer..

1517


Some time when i wanna learn the object i face issue like i am not able learn the object in proper manner... eg:for text bo on web page it should learn as webedit but some times it reads as winobject:internetexpoler-server, because of this i have to uninstall the qtp and re-install it again when i do this it reads the object perfectly.....plz suggest the soln

1398


how do i know how to use tools

1455


Hi, While recording a Jave based web application, its recording all my actions and the objects.And I have 5 WebEdit objects on the page and all are recorded. But while execution, at the 2 WebEdit object, its entering the value into the object (Its making a call to the AJAX, matching the value), when the control get out of this object the value is erased or cleared. Could anyone please help. I have recoreded 5 more scenarios where WebEdit is in the picture on different webpages and all are working fine. Here is my Script: Browser("Sign In").Page("Matching Workbench_3").WebEdit ("locationLookup").Set "0320 - SEATTLE-KM" Browser("Sign In").Page("Matching Workbench_3").WebEdit ("supplierNameLookup").Set "TRAMMO PETROLEUM INC" *** SupplierNameLookup is the object, which is haing an issue. And also I was using the SendString function, but it didnt work.

1773


How to Open FireFox using descriptive programing? If my question is not clear, i will give an Example To Open Internet Explorer, We use Set IE = CreateObject(InternetExplorer.Application) IE.Navigate "www.yahoo.com In the same i need to open yahoo.com in firefox. Can any one tell me what is the server name of firefox to create an object

2530


What ate the Technologies supported by QTP?

648


In QTP can we feed the out of one browser(internet explorer) as an input to the another browser(mozilla firefox)? If yes explain how to do it with an example.

1535


Explain hybrid framework with advantages and disadvantages?

546