silentsolo / robotium

Automatically exported from code.google.com/p/robotium
0 stars 0 forks source link

xpath result contains only one html node #661

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
html:
<html>
    <body>
        <div>1</div>
        <div>2</div>
    </body>
</html>

java:
ArrayList<WebElement> webElements = soloAddon.getWebElements( By.xpath( "//div" 
) );
System.out.println( "webElements count=" + webElements.size() );

What is the expected output? What do you see instead?
Expected:
webElements count=2

Actual:
webElements count=1

What version of the product are you using? On what operating system?
Robotium Solo 5.3.1
Android 4.4 Kit Kat

Actually bug was found in RobotiumWeb.js in javascript function xpath. In while 
cycle when you iterate to next element you use wrong variable name "result". 
You should use variable "elements" to call iterateNext().

Original issue reported on code.google.com by dmitry.t...@gmail.com on 20 Feb 2015 at 11:36

GoogleCodeExporter commented 9 years ago
Thanks for reporting this. 

Original comment by renasr...@gmail.com on 24 Feb 2015 at 12:29

GoogleCodeExporter commented 9 years ago
This has been fixed in Robotium 5.4.1. 

Original comment by renasr...@gmail.com on 27 May 2015 at 1:39