3

I need to fetch each FrameLayot div value inside the RecyclerView.

AS Shown in the image

I used the code

List<WebElement> ulElement = driver.findElements(By.id("pager"));

int sz = ulElement.size();

System.out.println(sz);

But getting result as 1 instead of 9

Parthan P Vasu
  • 63
  • 4
  • 10

2 Answers2

0

If you want to get the result as 9 you should use the following code:

List<WebElement> ulElement = driver.findElements(By.xpath("//android.support.v7.widget.RecyclerView[@index='0']/give_the_class_name_of_framelayout"));

int sz = ulElement.size();

System.out.println(sz);

You have to give such value to the locator, so that it will return 9 matching elements. I hope this helps you out.

Suraj Jogdand
  • 308
  • 2
  • 17
0

I got the Result by split the view

WebElement parentElement  = driver.findElement(By.id("com.mathrubhumi.silverbullet:id/mlist"));
List<WebElement> childElement = parentElement.findElements(By.id("com.mathrubhumi.silverbullet:id/rootview"));
System.out.println(celement.size());
Parthan P Vasu
  • 63
  • 4
  • 10