Wednesday , August 27 2014
Home » Testing » QTP » QTP Function to Click a Link in a Web Table
QTP Function to Click a Link in a Web Table
QTP Function to Click a Link in a Web Table

QTP Function to Click a Link in a Web Table

In this post we bring you a QTP function that can click a link in a WebTable based on value present in same or another column in the same row.

What the function does?
While doing automation on web applications we get scenarios where we have to click a particular link in a web table which has a number of items in it. In some cases these links may be dynamic based on selected filters and all. In such a case it is difficult to click a specific link. This function helps you to click a link based on link text or based on the text available on other columns in the web table.

For example let us consider the following web table with some student data.

As you can see each student listed in the table has individual Address Link and Progress Report Link. So in this case what if you want to click the link against the student Mahesh? Well in such a scenario you can make use of this function.

The code below will call the function so that it clicks the address link against the student ‘Mahesh’.

Now the function ‘SearchTextAndClickLink’ will be called.

About Kannan Suresh

I am a software test engineer at EY & proud owner of Nucleation. I love to share my knowledge in UFT, ALM, Excel VBA & other technologies through Nucleation. Keep in touch with me by visiting the links below.