sassernetsky / robotium

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

xpath result contains only one html node #661

Open GoogleCodeExporter opened 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