I need to fetch each FrameLayot div value inside the RecyclerView.
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
I need to fetch each FrameLayot div value inside the RecyclerView.
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
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.
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());