简体   繁体   English

QTP中的对象必需错误

[英]Object Required error in QTP

I am trying to click on 3rd link in a cell(2,3) of a web table(Emp Index) 我正在尝试单击Web表的单元格(2,3)中的第三个链接(Emp Index)

Set EditLink = Browser("Browser").Page("Page").WebTable("Emp Index").ChildItem(2,3,"Link",2) EditLink.Click 设置EditLink = Browser(“ Browser”)。Page(“ Page”)。WebTable(“ Emp Index”)。ChildItem(2,3,“ Link”,2)EditLink.Click

While running the script QTP displaying "Object required: Line(2) EditLink.click" error. 运行脚本QTP时显示“需要对象:Line(2)EditLink.click”错误。 any body can u please assist on this. 任何人你都可以帮忙。

This error is returned when the cell exists and there are childobjects of type link, but not with this index (3). 当单元格存在并且存在子类型为link的子对象但不具有此索引(3)时,将返回此错误。 Try to see if you can confirm that the link with index 0 exists by: 尝试通过以下方法查看是否可以确认索引为0的链接是否存在:

Set EditLink = Browser("Browser").Page("Page").WebTable("Emp Index").ChildItem(2,3,"Link",0) 
MsgBox EditLink.Exist(0)

To see where that link is placed on your page, you can use EditLink.Highlight 若要查看该链接在页面上的放置位置,可以使用EditLink.Highlight
From this point you can start debugging to see if the link with index 1, 2 and finally 3 exists. 从这一点开始,您可以开始调试以查看索引为1、2和最后为3的链接是否存在。

Try using a function to click link in a webtable. 尝试使用功能单击Web表中的链接。

Check this link . 检查此链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM