简体   繁体   中英

Object Required error in QTP

I am trying to click on 3rd link in a cell(2,3) of a web table(Emp Index)

Set 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. 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). Try to see if you can confirm that the link with index 0 exists by:

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
From this point you can start debugging to see if the link with index 1, 2 and finally 3 exists.

Try using a function to click link in a webtable.

Check this link .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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