How to click a particular link in a web table?
Q: There are three columns in a webtable (i) Account Name (ii) Account Number (iii) Operation. In the first row of third column there are three links (Update, Delete and Edit) in the second row of the third column one link (Edit) is there and in third row of the third column two links (Edit and Delete) are there. All these links can be in any orders. Can any one please help me as to how to write a script to click on the Delete link wherever it appears in the webtable.
I was trying to solve similar thing few months back. You can try the following way:-
1. Search the required row number.
2. Search the required column number.
3. look for the childitemcount on the row and column number as above for class "link"
4. Above will return the total number of links and loop through each link to find the delete link.
Once the right link is found you can click on it.
</title> <link href="style.css" rel="stylesheet" type="text/css" /> <title>Automation Testing frameworks , tools , utilities along with automated testing solution and manual testing utilities to save time and increase productivity.
I'm thinking of an approximate way to do this. It is not a full answer, but maybe could be of use. (maybe.)
Could you use .childobject()? Something such as:
For J = 1 to 3
value = Browser("").Page("").WebTable("").GetChildObject(5 ,1,"link",J).GetRObject("name")
If value = "Delete" Then
'We know which one is the Delete button.
You could also vary the first two parameters for row and column.
Hope this may be of use.