使用 HtmlUnitDriver 运行 Cucumber 测试
当我使用 FirefoxDriver 运行测试时,没有任何问题,但是当我将 FirefoxDriver 更改为 HtmlUnitDriver 时,会发生以下错误:
[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>'
感谢您的帮助
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案就在:
http://www.mail-archive.com/<跨度类=“__cf_email__” data-cfemail="7319041611061d1a075e0600160100331f1a0007005d001c06011016151c0114165d1d1607">[电子邮件受保护]/msg01390.html
您可能使用的是旧版本Commons-lang。使用 2.4 或更高版本。
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.