rshf / chromedriver

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

ChromeDriver fails to find elements but Firefox and IE seem to find the elements #212

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. The ChromeDriver starts
2. Chrome Browser is opened.
3. Browser is able to access the given URL.
4. The Element is displayed.
5. Chrome fails to detect/find the element and hence throws the following 
error: 
org.openqa.selenium.NoSuchElementException: The element could not be found 
(WARNING: The server did not provide any stacktrace information)

Simplified test case or site demonstrating the problem:

if(ENABLE_CHROME) {

File file = new 
File("C:\\devapps\\Selenium\\selenium-2.25.0\\chromedriver.exe");
System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());

DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("chrome.switches", 
Arrays.asList("--start-maximized"));

drivers.add(new ChromeDriver(capabilities));
        }

getDriver().get(getDomain() + "/cms");

WebElement usernameElement = getDriver().findElement(By.name("j_username"));
usernameElement.clear();
usernameElement.click();
usernameElement.sendKeys(username);

What version of the product are you using? On what operating system?
ChromeDriver = 26.0.1383.0
Chrome = 25.0.1364.172
OS = Windows 7
Selenium-java = 2.31.0

Please attach chromedriver.log to your bug report if possible.
[0.000][INFO]:      ChromeDriver 26.0.1383.0 
C:\devapps\Selenium\selenium-2.25.0\chromedriver.exe

[0.979][FINE]:      Initializing session with capabilities {

   "browserName": "chrome",

   "chrome.switches": [ "--start-maximized" ],

   "platform": "ANY",

   "version": ""

}

[0.980][INFO]:      Launching chrome: "C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe" --disable-hang-monitor 
--disable-prompt-on-repost --dom-automation --full-memory-crash-report 
--no-default-browser-check --no-first-run --disable-background-networking 
--disable-sync --disable-translate --disable-web-resources 
--safebrowsing-disable-auto-update --safebrowsing-disable-download-protection 
--disable-client-side-phishing-detection --disable-component-update 
--disable-default-apps --enable-logging --log-level=1 
--ignore-certificate-errors --start-maximized about:blank

[1.646][INFO]:      Connected to Chrome successfully. Version: 25.0.1364.172

[1.650][FINE]:      Command received (/session/c18f3ffd51954b9d922e9fd6201e1096)

[1.651][FINE]:      Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 0,

   "value": {

      "acceptSslCerts": false,

      "applicationCacheEnabled": false,

      "browserConnectionEnabled": false,

      "browserName": "chrome",

      "chrome.chromedriverVersion": "26.0.1383.0",

      "cssSelectorsEnabled": true,

      "databaseEnabled": false,

      "handlesAlerts": true,

      "javascriptEnabled": true,

      "locationContextEnabled": false,

      "nativeEvents": true,

      "platform": "windows",

      "rotatable": false,

      "takesScreenshot": true,

      "version": "25.0.1364.172",

      "webStorageEnabled": true

   }

}

[1.654][FINE]:      Command received 
(/session/c18f3ffd51954b9d922e9fd6201e1096/execute) with params {

   "args": [  ],

   "script": "window.moveTo(0,0); window.resizeTo(screen.width, screen.height);"

}

[1.654][FINER]:     Waiting for all views to stop loading...

[1.654][FINER]:     Done waiting for all views to stop loading

[1.698][FINER]:     Waiting for all views to stop loading...

[1.698][FINER]:     Done waiting for all views to stop loading

[1.698][FINE]:      Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096/execute) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 0,

   "value": null

}

[1.701][FINE]:      Command received 
(/session/c18f3ffd51954b9d922e9fd6201e1096/url) with params {

   "url": "https://preview.clickability.com/cms"

}

[1.701][FINER]:     Waiting for all views to stop loading...

[1.702][FINER]:     Done waiting for all views to stop loading

[4.764][FINER]:     Waiting for all views to stop loading...

[4.771][FINER]:     Done waiting for all views to stop loading

[4.771][FINE]:      Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096/url) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 0,

   "value": {

   }

}

[4.784][FINE]:      Command received 
(/session/c18f3ffd51954b9d922e9fd6201e1096/elements) with params {

   "using": "xpath",

   "value": "//ul[@class=\"tabs\"]/li[@class=\"active\"]/div/a"

}

[4.784][FINER]:     Waiting for all views to stop loading...

[4.784][FINER]:     Done waiting for all views to stop loading

[4.832][FINER]:     Waiting for all views to stop loading...

[4.832][FINER]:     Done waiting for all views to stop loading

[4.832][FINE]:      Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096/elements) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 0,

   "value": [  ]

}

[4.836][FINE]:      Command received 
(/session/c18f3ffd51954b9d922e9fd6201e1096/elements) with params {

   "using": "xpath",

   "value": "//ul[@class=\"tabs\"]/li[@class=\"active\"]/div/a"

}

[4.836][FINER]:     Waiting for all views to stop loading...

[4.837][FINER]:     Done waiting for all views to stop loading

[4.846][FINER]:     Waiting for all views to stop loading...

[4.846][FINER]:     Done waiting for all views to stop loading

[4.846][FINE]:      Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096/elements) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 0,

   "value": [  ]

}

[4.849][FINE]:      Command received 
(/session/c18f3ffd51954b9d922e9fd6201e1096/elements) with params {

   "using": "xpath",

   "value": "//ul[@class=\"tabs\"]/li[@class=\"active\"]/div/a"

}

[4.849][FINER]:     Waiting for all views to stop loading...

[4.849][FINER]:     Done waiting for all views to stop loading

[4.856][FINER]:     Waiting for all views to stop loading...

[4.856][FINER]:     Done waiting for all views to stop loading

[4.856][FINE]:      Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096/elements) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 0,

   "value": [  ]

}

[4.859][FINE]:      Command received 
(/session/c18f3ffd51954b9d922e9fd6201e1096/title)

[4.859][FINER]:     Waiting for all views to stop loading...

[4.859][FINER]:     Done waiting for all views to stop loading

[4.863][FINER]:     Waiting for all views to stop loading...

[4.863][FINER]:     Done waiting for all views to stop loading

[4.863][FINE]:      Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096/title) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 0,

   "value": "Dynamic Site Platform - Login"

}

[4.865][FINE]:      Command received 
(/session/c18f3ffd51954b9d922e9fd6201e1096/url)

[4.865][FINER]:     Waiting for all views to stop loading...

[4.865][FINER]:     Done waiting for all views to stop loading

[4.868][FINER]:     Waiting for all views to stop loading...

[4.868][FINER]:     Done waiting for all views to stop loading

[4.868][FINE]:      Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096/url) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 0,

   "value": "https://preview.clickability.com/cms"

}

[4.870][FINE]:      Command received 
(/session/c18f3ffd51954b9d922e9fd6201e1096/url) with params {

   "url": "preview.clickability.com/cms?action=doLogout"

}

[4.871][FINER]:     Waiting for all views to stop loading...

[4.871][FINER]:     Done waiting for all views to stop loading

[5.053][FINER]:     Waiting for all views to stop loading...

[5.054][FINER]:     Done waiting for all views to stop loading

[5.055][FINE]:      Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096/url) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 0,

   "value": {

   }

}

[5.057][FINE]:      Command received 
(/session/c18f3ffd51954b9d922e9fd6201e1096/url)

[5.057][FINER]:     Waiting for all views to stop loading...

[5.057][FINER]:     Done waiting for all views to stop loading

[5.060][FINER]:     Waiting for all views to stop loading...

[5.060][FINER]:     Done waiting for all views to stop loading

[5.060][FINE]:      Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096/url) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 0,

   "value": "chrome://newtab/"

}

[5.062][FINE]:      Command received 
(/session/c18f3ffd51954b9d922e9fd6201e1096/url) with params {

   "url": "newtab/cms"

}

[5.062][FINER]:     Waiting for all views to stop loading...

[5.062][FINER]:     Done waiting for all views to stop loading

[5.105][FINER]:     Waiting for all views to stop loading...

[5.107][FINER]:     Done waiting for all views to stop loading

[5.107][FINE]:      Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096/url) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 0,

   "value": {

   }

}

[5.110][FINE]:      Command received 
(/session/c18f3ffd51954b9d922e9fd6201e1096/element) with params {

   "using": "xpath",

   "value": "//input[@name=\"j_username\"]"

}

[5.110][FINER]:     Waiting for all views to stop loading...

[5.110][FINER]:     Done waiting for all views to stop loading

[5.141][FINER]:     Waiting for all views to stop loading...

[5.141][FINER]:     Done waiting for all views to stop loading

[5.141][WARNING]:   Command finished 
(/session/c18f3ffd51954b9d922e9fd6201e1096/element) with response {

   "sessionId": "c18f3ffd51954b9d922e9fd6201e1096",

   "status": 7,

   "value": {

      "message": "The element could not be found"

   }

}

[5.143][FINE]:      Command received (/session/c18f3ffd51954b9d922e9fd6201e1096)

[6.071][INFO]:      Chrome shutdown

Original issue reported on code.google.com by ashiq.ra...@gmail.com on 13 Mar 2013 at 10:13

GoogleCodeExporter commented 9 years ago

Original comment by kkania@chromium.org on 13 Mar 2013 at 11:55

GoogleCodeExporter commented 9 years ago

Original comment by kkania@chromium.org on 14 Mar 2013 at 9:20

GoogleCodeExporter commented 9 years ago

Original comment by kkania@chromium.org on 14 Mar 2013 at 9:21

GoogleCodeExporter commented 9 years ago
I get this problem too and hope somebody will share what the problem and how to 
fix it.

Original comment by suci...@gmail.com on 10 Jun 2013 at 12:26

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
 ashiq.rahman716@ 

Is this issue still reproducible ? with latest version of ChromeDriver (2.15), 
selenium (2.45) and chrome (41.xx.xx.xx).

I'm unable to reproduce the issue, please attach a correct chromedriver.log 
file if this issue still reproducible.

------------------- java ------------
            ChromeOptions options =new ChromeOptions();
            options.addArguments("--start-maximized");
            WebDriver driver = new ChromeDriver(options);
    driver.get("https://preview.clickability.com/cms?action=doLogout"); 
    Thread.sleep(1000);
    WebElement usernameElement = driver.findElement(By.name("j_username"));
    usernameElement.clear();
    usernameElement.click();
    usernameElement.sendKeys("username");

Original comment by agau...@chromium.org on 13 Apr 2015 at 9:24