Object Required error in QTP

qtpvbscript

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.

Best Answer

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.

Related Topic