Issue 3102 in selenium: Using getAttribute("disabled") on a non-input element always returns false

328 views
Skip to first unread message

sele...@googlecode.com

unread,
Dec 21, 2011, 8:30:34 AM12/21/11
to selenium-deve...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3102 by yish...@gmail.com: Using getAttribute("disabled") on a
non-input element always returns false
http://code.google.com/p/selenium/issues/detail?id=3102

The application I'm testing has button components that use the
attribute-value pair "disabled"="disabled" to indicate that the button is
greyed out.
Trying to test whether the button is disabled always returns false.

To reproduce:
1. Get a <div> WebElement that has a "disabled" attribute.
Example of such an element:
<div id="foo" disabled="disabled">
<span class="buttonLeft"></span>
<span class="buttonCenter" >OK</span>
<span class="buttonRight"></span>
</div>
2. findElement(By.id("foo")).getAttribute("disabled")

Expected output: "disabled" or even "true"
Actual output: "false"

Selenium version: 2.3.1
OS: Windows 7
Browser: Chrome
Brower version: 16.0.912.63 m

I understand that getAttribute handles the attribute "disabled" in a
special way in order to make working with input fields easier. However,
using it on an element that is not an input should produce the normal
behavior.


sele...@googlecode.com

unread,
Dec 21, 2011, 10:46:47 PM12/21/11
to selenium-deve...@googlegroups.com
Updates:
Labels: Component-WebDriver

Comment #1 on issue 3102 by ajaykemp...@gmail.com: Using

getAttribute("disabled") on a non-input element always returns false
http://code.google.com/p/selenium/issues/detail?id=3102

(No comment was entered for this change.)

sele...@googlecode.com

unread,
Dec 26, 2011, 1:47:46 AM12/26/11
to selenium-deve...@googlegroups.com
Updates:
Labels: Browser-Chrome

Comment #2 on issue 3102 by barancev: Using getAttribute("disabled") on a

sele...@googlecode.com

unread,
Jan 17, 2012, 10:18:17 AM1/17/12
to selenium-deve...@googlegroups.com

Comment #3 on issue 3102 by kerborio...@gmail.com: Using
getAttribute("disabled") on a non-input element always returns false
http://code.google.com/p/selenium/issues/detail?id=3102

I have the bug with firefox 5.0.1

sele...@googlecode.com

unread,
Jan 17, 2012, 10:22:18 AM1/17/12
to selenium-deve...@googlegroups.com

Comment #4 on issue 3102 by kerborio...@gmail.com: Using
getAttribute("disabled") on a non-input element always returns false
http://code.google.com/p/selenium/issues/detail?id=3102

I have the same bug with firefox 5.0.1

sele...@googlecode.com

unread,
Jan 17, 2012, 10:31:23 AM1/17/12
to selenium-deve...@googlegroups.com
Updates:
Labels: -Browser-Chrome Browser-Atoms

Comment #5 on issue 3102 by dawa...@gmail.com: Using

getAttribute("disabled") on a non-input element always returns false
http://code.google.com/p/selenium/issues/detail?id=3102

(No comment was entered for this change.)

sele...@googlecode.com

unread,
Jan 17, 2012, 12:03:06 PM1/17/12
to selenium-deve...@googlegroups.com

Comment #6 on issue 3102 by maxime.m...@gmail.com: Using
getAttribute("disabled") on a non-input element always returns false
http://code.google.com/p/selenium/issues/detail?id=3102

I even have the same issue with an input field that has disabled="disabled".

Selenium Driver 2.16.1
Firefox 9.0.1

Reply all
Reply to author
Forward
0 new messages