Sunday, 21 April 2013

QTP -Simple Program to navigate all the pages using Pagination link

Suppose there is thread in a forum and we wish to navigate all pages of the forum.
Below code can be useful

Thread url:
http://www.indianguitartabs.com/f6/hindi-chords-tabs-submitted-amit82cse-10624.html

This thread has 25 pages right now.


There is pagination panel provided at top part and near bottom part of this thread for navigation purpose.

To navigate to next page, user just need to click on next arrow, i.e symbol.
First of all, we need to this object in OR.

Below code clicks icon till it is visible. As user reaches 25th Page, this symbol disappears and control comes out of the loop.

While (browser("Hindi Chords & Tabs Submitted").Page("Hindi Chords & Tabs Submitted").Image("Next").Exist(5) )

           browser("Hindi Chords & Tabs Submitted").Page("Hindi Chords & Tabs Submitted").Image("Next").Click

    Wend



No comments:

Post a Comment

Spring Boot : Exception Handler 14