分享

Set values to Webtable cell in QTP

 hildaway 2012-09-12
#1 Using
              setcelldata(row,Col,"Data")
 
# 2 For WebTable object, you can retreive the cell data but can't set any value directly.

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

   2)  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 object.

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, you need to take care of the object index.
 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多