URL: https://uk.webuy.com/search/index.php?stext=*§ion=&catid=956
[b:tpao88tw][u:tpao88tw]Scenario 1:[/u:tpao88tw][/b:tpao88tw]
List<WebElement> ab = d.findElements(By.xpath("//div[@class='searchRecord']/div[@class='desc']/h1/a"));
System.out.println(ab.size());
Size is displayed as [u:tpao88tw]15[/u:tpao88tw]
[attachment=0:tpao88tw]Webuy_list.png[/attachment:tpao88tw]
[b:tpao88tw][u:tpao88tw]Scenario 2:[/u:tpao88tw][/b:tpao88tw] when same xpath is used in different way, size is displayed as "[u:tpao88tw]1[/u:tpao88tw]"
WebElement a=d.findElement(By.xpath("//div[@class='searchRecord']/div[@class='desc']/h1"));
List<WebElement> ab=a.findElements(By.tagName("a"));
System.out.println(ab.size());
Size is displayed as "[u:tpao88tw]1[/u:tpao88tw]"
can you please let me know what is wrong in scenario 2 and why size is varying?
[attachment=1:tpao88tw]Webuy_Webelement.png[/attachment:tpao88tw]