Sunday, 6 July 2014

How to click on the buttons in table cells in QTP?

In software testing projects, many times we come across situations where we have to perform the operation on the objects relative to other objects. For example - in below table we have three view buttons. So to click on the view button for given emp id, you will have to first find the row number in which that emp id exists and then click on the view button in that row.
                     Emp Id                                Action                     
78989
7777
9999

We can use HTML DOM concept to handle such situations.
We can find the TD element which contains employee id say 7777. After this, we can use nextSibling property of the TD element to get the Next TD element and then find the child object (Button) of that TD using getElementsByName method.

In windows based applications, we can use relative identifier (Supported in QTP 11.5 onwards and UFT).

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com

No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.