Search code examples
seleniumcucumberbddwebdriverhtmlunit

Running cucumber tests with HtmlUnitDriver


When I run my tests with FirefoxDriver I have no problems, but when I just change FirefoxDriver to HtmlUnitDriver happens the follow error:

[INFO]   java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.startsWithIgnoreCase(Ljava/lang/String;Ljava/lang/String;)Z (NativeException)
[INFO]   com/gargoylesoftware/htmlunit/util/URLCreator.java:66:in `toUrlUnsafeClassic'
[INFO]   com/gargoylesoftware/htmlunit/util/UrlUtils.java:193:in `toUrlUnsafe'
[INFO]   com/gargoylesoftware/htmlunit/util/UrlUtils.java:171:in `toUrlSafe'
[INFO]   com/gargoylesoftware/htmlunit/WebClient.java:162:in `<clinit>'
[INFO]   org/openqa/selenium/htmlunit/HtmlUnitDriver.java:284:in `newWebClient'
[INFO]   org/openqa/selenium/htmlunit/HtmlUnitDriver.java:255:in `createWebClient'
[INFO]   org/openqa/selenium/htmlunit/HtmlUnitDriver.java:131:in `<init>'
[INFO]   org/openqa/selenium/htmlunit/HtmlUnitDriver.java:174:in `<init>'
[INFO]   org/openqa/selenium/htmlunit/HtmlUnitDriver.java:170:in `<init>'

Thanks for any help


Solution

  • The answer is on: http://www.mail-archive.com/[email protected]/msg01390.html

    You probably are using an older version of commons-lang. Use 2.4 or up.