ericmckean / chromedriver

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

driver.findElements(By.id("..")) not working correctly when id contains semicolon #975

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Issue Description
-----------------

driver.findElements(By.id("...")) returns 0 elements in case the ID contains 
semicolon although there are several elements with that ID.
An example of an ID that doesn't work with findElements is: 
"button_global;global.button.ok" or even simpler: "test;test"

This is completely wrong an I think this is a critical issue.

Steps to reproduce
------------------
Here it is a test class:

package test;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class BasicTest {

    public static void main(String[] args) throws InterruptedException {

        System.setProperty("webdriver.chrome.driver",
                "D:\\Projects\\Selenium\\ChromeDriver\\chromedriver2.12.exe");
        WebDriver driver = new ChromeDriver();
        driver.manage().window().maximize();

        driver.get("file:///D:/test_bug.html");

        Thread.sleep(1000);

        driver.findElement(By.id("test;test"));

        int no1 = driver.findElements(By.id("test;test")).size();
        System.out.println("NUMBER: " + no1);

        driver.quit();

    }
}

And a test file:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <title>second</title>
  </head>
  <body>
    <br> Test
    <br>
    <div id="test"> </div>
    <div id="test_test"> </div>
    <div id="test.test"> </div>
    <div id="test;test"> </div>

  </body>
</html>

This issue is reproducible:
- Chrome : chromedriver 2.12, selenium-server 2.43.1 (but I think this is 
reproducible also with older versions of selenium)
- Firefox: firefox 2.44, selenium-server 2.44

Original issue reported on code.google.com by danflu...@gmail.com on 13 Nov 2014 at 10:58

GoogleCodeExporter commented 9 years ago

Original comment by andrewch...@chromium.org on 17 Nov 2014 at 7:04

GoogleCodeExporter commented 9 years ago
for 
  driver.findElement(By.id("test;test"));
  all three work
    <div id="test_test"> </div>
    <div id="test.test"> </div>
    <div id="test;test"> </div>

it is the driver.findElements that does not work for
        <div id="test.test"> </div>
    <div id="test;test"> </div>
we will look into  it.

Original comment by andrewch...@chromium.org on 17 Nov 2014 at 8:53

GoogleCodeExporter commented 9 years ago
Yes, the problem is with "driver.findElements" only and not 
"driver.findElement". I reproduced the bug with semicolon only, for dot it 
worked for me.
This time I used: selenium-2.39 and ChromeDriver 2.12.301325
I submitted this bug to the Selenium project also: 
https://code.google.com/p/selenium/issues/detail?id=8173
because I didn't know where is the problem.

Thx

Original comment by danflu...@gmail.com on 18 Nov 2014 at 8:38

GoogleCodeExporter commented 9 years ago
We are looking into it, and will let you know  the outcome.

Original comment by andrewch...@chromium.org on 18 Nov 2014 at 6:19

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

workaround 
int no1 = driver.findElements(By.id("test\\;test")).size();

  we will fix it on next release.

Original comment by andrewch...@chromium.org on 21 Nov 2014 at 12:15

GoogleCodeExporter commented 9 years ago

Original comment by andrewch...@chromium.org on 20 Jan 2015 at 11:05

GoogleCodeExporter commented 9 years ago
To be released in ChromeDriver 2.14.

Original comment by samu...@chromium.org on 28 Jan 2015 at 6:53

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:21

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:57