Thanks , I used following line of code to attain my task:
Dimension dimensions = driver.manage().window().getSize();
Double screenHeightStart = dimensions.getHeight() * 0.5;
int scrollStart = screenHeightStart.intValue();
System.out.println("s="+scrollStart);
Double screenHeightEnd = dimensions.getHeight() * 0.2;
int scrollEnd = screenHeightEnd.intValue();
ArrayList<String> result = new ArrayList<String>();
for (int i = 0; i < dimensions.getHeight(); i++)
{
driver.swipe(0,scrollStart,0,scrollEnd,0);
lst=driver.findElements(By.id("com.snapdeal.main:id/productTitle"));
for(WebElement lst_pro:lst)
{
String pro_name=lst_pro.getAttribute("text");
if(!result.contains(pro_name.trim()))
{
System.out.println("Name of Product :"+pro_name+" Product fetched Till Now :"+result.size());
result.add(pro_name.trim());
}
}
}
Its work but , still wonder why it is not getting last element text value .
Thanks for your help.