tags:

views:

422

answers:

2

How can i test pagination icon functionality for a web page using Selenium IDE?

+1  A: 

With most pagination, the current page is output as text somewhere on the page, and other pages are links. You could therefore verify that the current page text is present, and that other expected page links are also present. You can then click one of the alternate page links, and once the new page has loaded verify that the values have changed.

The following example makes some assumptions on your implemented IDs and page structure:

open | www.example.com/index.html?page=1
verifyText | id=currentPage | 1
verifyXpathCount | xpath=id('pagination')/a | 4
verifyText | xpath=id('pagination')/a[1] | 2
verifyText | xpath=id('pagination')/a[2] | 3
verifyText | xpath=id('pagination')/a[3] | 4
verifyText | xpath=id('pagination')/a[4] | 5
clickAndWait | xpath=id('pagination')/a[4]
verifyText | id=currentPage | 5

Assumed HTML snippet:

<div id="pagination">
    <span id="currentPage">1</span> | 
    <a href="index.html?page=2">2</a> | 
    <a href="index.html?page=3">3</a> | 
    <a href="index.html?page=4">4</a> | 
    <a href="index.html?page=5">5</a>
</div>
Dave Hunt
A: 

Hi, I need simple test cases to testing pagination...

ravi mayuri