FuckTheWorld / chromedriver

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

chromedriver: selenium get false after calling "IsElementDisplayed" #1146

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
environment:
chrome:   43.0.2357.132
selenium: 2.46
driver:   2.16
os:  windows 7
lang: java
html:
<div>
 <label class="checkBoxClassSize">
    <div index="0" class="customcheckbox">
        <input id="check" type="checkbox" name="b">
    </div>
 </label>
</div>
class "customcheckbox" contains "display: inline-block", the checkbox is 
visible and clickable

but through debugging, selenium get false after calling "IsElementDisplayed"

the chromedriver.log is 
[207.333][INFO]: Waiting for pending navigations...
[207.333][INFO]: Done waiting for pending navigations
[207.339][INFO]: Waiting for pending navigations...
[207.339][INFO]: Done waiting for pending navigations
[207.339][INFO]: RESPONSE IsElementDisplayed false
[207.443][INFO]: COMMAND IsElementDisplayed {
   "id": "0.42759483004920185-5"
}

Original issue reported on code.google.com by zhuxuy...@huawei.com on 10 Jul 2015 at 3:12

GoogleCodeExporter commented 9 years ago
 zhuxuyong@

thanks for filing bug, have verified locally in the same environment as 
mentioned above by you, and could not reproduce the issue.

can you please attach sample testcase here.

thanks 
-------- java -------
WebDriver driver = new ChromeDriver();
                driver.get("file:///usr/local/xxx/Documents/SampleHTML/bug1146.html");
                WebElement ele = driver.findElement(By.className("customcheckbox"));     
                WebElement ele2= driver.findElement(By.id("check"));

                if (ele.isDisplayed()) {
                    System.out.println("Element is Visible: identified by class");
                } else {
                    System.out.println("Element is Absent when identified by class");
                }
                if (ele2.isDisplayed()) {
                    System.out.println("Element is Visible: identified by id");
                } else {
                    System.out.println("Element is Absent when identified by id");
                }
                if (ele.isEnabled()) {
                    System.out.println("Element is enabled: identified by class");
                } else {
                    System.out.println("Element is Not enabled");
                }
                ele2.click();

                if (ele2.isSelected()) {
                    System.out.println("Element is selected: identified by id");
                } else {
                    System.out.println("Element is Not selected");
                }

Original comment by agau...@chromium.org on 10 Jul 2015 at 6:46

GoogleCodeExporter commented 9 years ago

Original comment by agau...@chromium.org on 10 Jul 2015 at 6:47