vbscriptqtphp-uftuft14

How to click on Web Table column's Web Button in following case?


Web Table

I have one web table, in this I want to delete particular record by clicking on record's delete button.

I got the value of row but I am not able to perform click on web button of particular row and also there is 2 buttons in one column.

How to click on delete icon of particular row?


Solution

  • You need to set a reference to the item within the specific row and then click on it - something like this:

    Set oLink = Browser("myBrowser").Page("myPage").WebTable("myTable").ChildItem(iRow,8,"Link",0)
    oLink.Click
    

    You will potentially need to amend the "Link" and the number 8 in your own code. iRow represents the row you are trying to interact with.

    Essentially what this code does is set an object reference to the first item of type "Link", in column 8 of the table, then uses a Click event to select it. If your delete icon is a WebButton, then replace "Link" with "WebButton" for example. The final 0 in the command tells UFT to select the first element matching the object type - you might need 1 if your two icons are in the same column of the table.

    Let me know if that helped.