jwebunit和htmlunit的常见问题

来源:百度文库 编辑:神马文学网 时间:2024/05/11 15:42:20
1.
What can I do when JavaScript errors are thrown with JWebUnit (and HtmlUnit testing engine), but not in my browser?

First, check if your JavaScript is not browser specific. When possible, try to write a minimal test case that reproduce your error, and submit it to the HtmlUnit team to help them to improve HtmlUnit.
Finally, you can temporary disable JavaScript in your test:

public void testFoo() {beginAt("blabla");...setScriptingEnabled(false);...//Problematic codesetScriptingEnabled(true);...}
Have a look at http://htmlunit.sourceforge.net/submittingJSBugs.html