JavaScript
JUnitPerf
JWebUnit uses a testing engine to manipulate DOM and JavaScript. That's why
JavaScript support depend on the testing engine. In the past, JWebUnit was based on HttpUnit.
JavaScript support of HttpUnit is very poor.
Now, JWebUnit main testing engine is HtmlUnit. HtmlUnit understanding of JavaScript is quite good.
| [top] |
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 code
setScriptingEnabled(true);
...
}
| [top] |
Yes, but you have to take care when writing your JUnitPerf test. You need to use a TestFactory:
int users = 10; Test factory = new TestFactory(MyJWebUnitTest.class); Test loadTest = new LoadTest(factory, users);
| [top] |