Pagination | Selenium Forum
M
Posted on 24/04/2016
hi!

In pagination i want to read url for next and prevoius page from source and then compare it with actual url , i am unable to capture url of next and previous page .is there something i am missing ?

M
Replied on 25/04/2016

how are you trying to capture th url?


M
Replied on 06/05/2016

i used geturl ,
try{
String actualval=null;
if(object!="")
{

actualval=driver.findElement(By.xpath(OR.getProperty(object))).getAttribute("href");

}
else{
actualval =driver.getCurrentUrl();}


this is working fine for current url but i need to pull up url from source page which has next and previous in it..

view-source:http://www.ebay.com/sch/i.html?_from=R40&_sacat=0&_nkw=laptop&_pgn=2&_skc=50&rt=nc

how to identify the next page url in here ?


M
Replied on 06/05/2016

send a screen shot and complete code.


M
Replied on 06/05/2016

try{
String actualval=null;
if(object!="")
{

actualval=driver.findElement(By.xpath(OR.getProperty(object))).getAttribute("href");

}
else{
actualval =driver.getCurrentUrl();}



is the main code under a function created for url , however i need to identify with a function that will get the url for 5th page specifically , can you please help to modify the function in this case

Responsive image

M
Replied on 06/05/2016

use actions class. the website is using javascript


M
Replied on 07/05/2016

[quote="qtpselenium.supp0rt@gmail.com":1fm7b63m]use actions class. the website is using javascript[/quote:1fm7b63m]

i could not understand it, can you pl provide more info or sample code thanks


M
Replied on 09/05/2016

watch module where actions class is explained. module 15.