Tag: htmlunit

在unit testing中获取错误“Provider com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl”但在主程序中没有

我在C#中构建一个应用程序,它使用com.gargoylesoftware.htmlunit.WebClient来访问和检索来自网页的信息。 我的应用程序从主项目运行良好,但当我尝试构建unit testing来测试项目类时,我收到以下错误: FactoryConfigurationError Message “Provider com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl not found” Source “IKVM.OpenJDK.XML.API” string StackTrace ” at javax.xml.parsers.DocumentBuilderFactory.newInstance() at com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration.loadConfiguration(Reader configurationReader) at com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration.loadConfiguration() at com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration..ctor(BrowserVersion ) at com.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration.getInstance(BrowserVersion browserVersion) at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine..ctor(WebClient webClient) at com.gargoylesoftware.htmlunit.WebClient.init(BrowserVersion , ProxyConfig ) at com.gargoylesoftware.htmlunit.WebClient..ctor(BrowserVersion browserVersion) at com.gargoylesoftware.htmlunit.WebClient..ctor() at GWT.HeadlessBrowser..ctor() in C:\\hg\\EXE\\GWT\\HeadlessBrowser.cs:line 57 at TestGWT.ProgramTest.TestLogInProcessForGWT() in C:\\hg\\TestGWT\\ProgramTest.cs:line 115″ 尝试在unit testing类中创建HtmlUnit WebClient也会导致此错误。 我在主项目和包含unit testing的项目中都有项目引用htmlunit-2.7,IKVM.OpenJDK.Core和IKVM.OpenJDK.XML.API。 […]

.net相当于htmlunit?

有人知道是否有.net相当于htmlunit或类似的库? 我听说有人用IKVM来转换htmlunit库。 但我也听说转换后的代码很慢。 要求: 无头浏览器 支持javascript 处理cookies 。净