MarkusBernhardt / robotframework-selenium2library-java

Java port of the Selenium 2 (WebDriver) Python library for Robot Framework
Apache License 2.0
46 stars 51 forks source link

Avoid NullPointerException in isEnabled method #56

Closed atmcarmo closed 10 years ago

atmcarmo commented 10 years ago

Added null validation of readonly variable in protected boolean isEnabled(String locator) method. Please see issue https://github.com/MarkusBernhardt/robotframework-selenium2library-java/issues/53

Basically, this avoids a NullPointerException if the html element doesn't have the "readonly" attribute.

Use this Robot test to check it:

*** Settings ***
Library  Selenium2Library

*** Test Cases ***

Test Should Be Pass and Should Not Throw a RuntimeException
    Open Browser    http://www.zkoss.org/zkdemo/input/form_sample    firefox    mainbrowser
    Wait Until Keyword Succeeds  10 sec  1 sec  Element Should Be Enabled  //input[../../../td[1]//span[contains(text(), 'Password')]]
    Close All Browsers

I am available for any questions you have.

Thank you