4 Replies Latest reply on Mar 19, 2009 4:27 AM by Gokhan Cetin

    problem clicking elements of richfaces tree using htmlunit

    Gokhan Cetin Newbie

      I am new to jsfunit testing and I have a richfaces tree which is binded to a backing bean. The menu items are coming according to user rights. Problem is this tree is rendered as a table in html form.I need to click the tabledatacells or tablerows to invoke the onselect method on the server side. I have a td linking to "system configuration".
      My code is as below

      client=session.getJSFClientSession();
      server=session.getJSFServerSession();
      page=(HtmlPage) client.getContentPage();
      ClickableElement clk=(ClickableElement) page.getByXPath
      (".//td[contains(text(),'System Configuration')]").get(0);
      clk=(ClickableElement)clk.getPreviousSibling();
      System.out.println(clk.getId()+clk.getTextContent());
      page=clk.click();
      

      However it doesnt invoke anything.
      When i try to click with client.click(clk.getID);
      it throws an exception like this

      Wrapped com.gargoylesoftware.htmlunit.ScriptException: Wrapped java.lang.NullPointerException (http://localhost:8080/app/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10) (http://localhost:8080/app/a4j.res/org/richfaces/renderkit/html/scripts/events.js.cmd#8)

      ======= EXCEPTION START ========
      Exception class=[org.mozilla.javascript.WrappedException]
      com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: Wrapped java.lang.NullPointerException (http://localhost:8080/app/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10) (http://localhost:8080/app/a4j.res/org/richfaces/renderkit/html/scripts/events.js.cmd#8)
      at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:513)
      at org.mozilla.javascript.Context.call(Context.java:515)
      at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
      at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
      at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:961)
      at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:135)
      at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:172)


      so problem is how can i click richfaces tree rows or columns and invoke its onselect method by htmlunit.Normally it works perfect.

        • 1. Re: problem clicking elements of richfaces tree using htmlun
          Stan Silvert Master

          Hi,

          What does the System.out.println() show? Are you sure your XPath query found the right element?

          At first glance, this looks like an HtmlUnit bug in processing the javascript. Can you post the complete stack trace?

          Stan

          • 2. Re: problem clicking elements of richfaces tree using htmlun
            Gokhan Cetin Newbie

            tnx for your reply mate.
            First of all i tell you what i am tryin to do.
            I have a managedbean as "menubean" for this richfaces tree.
            There is a right region where activepage is loaded from menubean.
            It has a method like public void onSelect(NodeSelectedEvent event).
            When a node is selected that nodes name property is passed to the menubean's activepage property.
            So i am just tryin to click the correct node but onSelect method does not fire at any time.


            My html output is as below

            <table border="0" cellpadding="0" cellspacing="0" id="mainform:_id43:1:_id44" style="width: 100%;" rich:nodeId="_id44"><tbody><tr id="mainform:_id43:1:_id44:mainRow" onclick=" return false;"><td class="dr-tree-h-ic dr-tree-h-ic-line-node"><div><a href="#" id="mainform:_id43:1:_id44:handle" onclick=" return false;"><img border="0" class="dr-tree-pointer-cursor dr-tree-h-ic-img" id="mainform:_id43:1:_id44:handle:img:collapsed" src="/surgategui/a4j.res/org.richfaces.renderkit.html.images.TreePlusImage/DATA/eAFb85aBtbiIwT6.KF2vKDM5Iy0xObVYryg1LyW1KDuzRC-jJDdHLzM3MR0oGlKUmuoJYjolFqeqwHkuiSWJEtwn39-.9o2ZiYHZh4EnOT-vpCg.xzk.J7-ohEHYJyuxLFE.JzEvXd8zryQ1PbXIGqgoPTUvtSgRoqiQoY6B0YeBs6QoMxesCyxQUQB0mSBIsx5Isx5Us9CjBUu-N7ZbMDEwejKwliXmlKZWFDEIINT5leYmpRa1rZkqyz3lQTcTA0NFwX8gKAYZyvyfgYEByjp27RUAFzJdYg__.cmd" /><img border="0" class="dr-tree-pointer-cursor dr-tree-h-ic-img" id="mainform:_id43:1:_id44:handle:img:expanded" src="/surgategui/a4j.res/org.richfaces.renderkit.html.images.TreeMinusImage/DATA/eAFb85aBtbiIwT6.KF2vKDM5Iy0xObVYryg1LyW1KDuzRC-jJDdHLzM3MR0oGlKUmuoJYjolFqeqwHkuiSWJEtwn39-.9o2ZiYHZh4EnOT-vpCg.xzk.J7-ohEHYJyuxLFE.JzEvXd8zryQ1PbXIGqgoPTUvtSgRoqiQoY6B0YeBs6QoMxesCyxQUQB0mSBIsx5Isx5Us9CjBUu-N7ZbMDEwejKwliXmlKZWFDEIINT5leYmpRa1rZkqyz3lQTcTA0NFwX8gKAYZyvyfgYEByjp27RUAFzJdYg__.cmd" style="display: none;" /></a></div></td><td class="dr-tree-h-ic dr-tree-h-ic-line-clp" id="mainform:_id43:1:_id44:icon" rich:ajaxselectedlistener="ajax_selected_listener_flag" rich:draggableoptions="{'parameters':{'dragSourceId':'mainform:_id43:1:_id44','mainform:_id43:1:_id44':'mainform:_id43:1:_id44'} } " rich:dropzoneoptions="{'parameters':{} } "><img class="dr-tree-h-ic-img" src="/surgategui/images/tree/small/klasor.png" /></td><td class="dr-tree-h-text rich-tree-node " id="mainform:_id43:1:_id44:text" nowrap="nowrap" rich:highlightedclass="dr-tree-i-hl rich-tree-node-highlighted" rich:selectedclass="dr-tree-i-sel rich-tree-node-selected">
             System Configuration</td></tr><tr id="mainform:_id43:1:_id44:childs" style="display: none;"><td class="dr-tree-h-ic-line"></td><td colspan="2" id="mainform:_id43:1:_id44:childs:td" valign="top"><table border="0" cellpadding="0" cellspacing="0" id="mainform:_id43:1:2:_id44" style="width: 100%;" rich:nodeId="_id44"><tbody><tr id="mainform:_id43:1:2:_id44:mainRow" onclick=" return false;"><td class="dr-tree-h-ic dr-tree-h-ic-line-node"><div><img class="dr-tree-h-ic-img" id="mainform:_id43:1:2:_id44:handle:img" src="/surgategui/a4j.res/images/spacer.gif.cmd" /></div></td><td class="dr-tree-h-ic dr-tree-h-ic-line-clp" id="mainform:_id43:1:2:_id44:icon" rich:ajaxselectedlistener="ajax_selected_listener_flag" rich:draggableoptions="{'parameters':{'dragSourceId':'mainform:_id43:1:2:_id44','mainform:_id43:1:2:_id44':'mainform:_id43:1:2:_id44'} } " rich:dropzoneoptions="{'parameters':{} } "><img class="dr-tree-h-ic-img" src="/surgategui/images/tree/small/network-16x16.png" /></td><td class="dr-tree-h-text rich-tree-node " id="mainform:_id43:1:2:_id44:text" nowrap="nowrap" rich:highlightedclass="dr-tree-i-hl rich-tree-node-highlighted" rich:selectedclass="dr-tree-i-sel rich-tree-node-selected">
             Network</td></tr></tbody></table>


            It is like this System Configuration > Network.
            I first press system configuration then i press network.
            I changed the code some but still no solution.Xpath works well it gets the correct td element.I get get all elements with getparent(), getprevioussibbling(), getnextsibbling() etc by the way.

            @SuppressWarnings("unchecked")
             public void testMenu()throws Exception
             {
             page=(HtmlPage) client.getContentPage();
             HtmlElement clk=(HtmlElement) page.getByXPath
             ("//td[string()='System Configuration']").get(0);
             System.out.println(clk.getId()+clk.getTextContent());
             client.click(clk.getId());
             System.out.println(server.getManagedBeanValue("#{Menu.activePage}"));
            
             clk = (HtmlElement)page.getByXPath
             ("//td[string()='Network']").get(0);
             System.out.println(clk.getId()+clk.getTextContent());
             client.click(clk.getId());
             System.out.println(server.getManagedBeanValue("#{Menu.activePage}"));
            
             client.click("save_button");
             }
            


            Output is like this and ids are really correct.

            mainform:tree_menu:1:_id43:textSystem Configuration
            empty
            mainform:tree_menu:1:2:_id43:textNetwork



            ======= EXCEPTION START ========
            Exception class=[org.mozilla.javascript.WrappedException]
            com.gargoylesoftware.htmlunit.ScriptException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: Wrapped java.lang.NullPointerException (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10) (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/events.js.cmd#8)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:513)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:961)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:135)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:172)
            at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:576)
            at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:916)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:921)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.doMouseEvent(HtmlElement.java:1132)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.mouseDown(HtmlElement.java:1044)
            at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:99)
            at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:76)
            at org.jboss.jsfunit.jsfsession.JSFClientSession.click(JSFClientSession.java:226)
            at com.endersys.common.NetworkModuleTest.testMenu(NetworkModuleTest.java:184)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at junit.framework.TestCase.runTest(TestCase.java:154)
            at junit.framework.TestCase.runBare(TestCase.java:127)
            at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:153)
            at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:119)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:93)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:224)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java)
            at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:101)
            at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:224)
            at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java)
            at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doPost(JSFUnitServletRedirector.java:46)
            at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)
            at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:224)
            at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)
            at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doGet(JSFUnitServletRedirector.java:52)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:116)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
            at java.lang.Thread.run(Thread.java:619)
            Caused by: org.mozilla.javascript.WrappedException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: Wrapped java.lang.NullPointerException (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10) (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/events.js.cmd#8)
            at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1773)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183)
            at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:476)
            at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3330)
            at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
            at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
            at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:192)
            at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:437)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:507)
            ... 55 more
            Caused by: com.gargoylesoftware.htmlunit.ScriptException: Wrapped java.lang.NullPointerException (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:513)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:961)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:135)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:172)
            at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:576)
            at com.gargoylesoftware.htmlunit.javascript.host.EventNode.jsxFunction_fireEvent(EventNode.java:334)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
            ... 66 more
            Caused by: org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10)
            at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1773)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183)
            at org.mozilla.javascript.ScriptableObject.getImpl(ScriptableObject.java:2019)
            at org.mozilla.javascript.ScriptableObject.get(ScriptableObject.java:286)
            at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:63)
            at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1616)
            at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1437)
            at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1423)
            at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3027)
            at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:437)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:507)
            ... 79 more
            Caused by: java.lang.NullPointerException
            at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.isAncestorOfEventTarget(HTMLElement.java:1420)
            at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.jsxGet_offsetHeight(HTMLElement.java:1386)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
            ... 91 more
            WrappedException: org.mozilla.javascript.WrappedException: Wrapped com.gargoylesoftware.htmlunit.ScriptException: Wrapped java.lang.NullPointerException (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10) (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/events.js.cmd#8)
            at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1773)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183)
            at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:476)
            at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3330)
            at script(http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/events.js.cmd:8)
            at script(http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree-item.js.cmd:24)
            at script(http://localhost:8080/surgategui/a4j.res/org.ajax4jsf.framework.resource.PrototypeScript.cmd:9)
            at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
            at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
            at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:192)
            at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:437)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:507)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:961)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:135)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:172)
            at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:576)
            at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:916)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:921)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.doMouseEvent(HtmlElement.java:1132)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.mouseDown(HtmlElement.java:1044)
            at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:99)
            at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:76)
            at org.jboss.jsfunit.jsfsession.JSFClientSession.click(JSFClientSession.java:226)
            at com.endersys.common.NetworkModuleTest.testMenu(NetworkModuleTest.java:184)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at junit.framework.TestCase.runTest(TestCase.java:154)
            at junit.framework.TestCase.runBare(TestCase.java:127)
            at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:153)
            at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:119)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:93)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:224)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java)
            at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:101)
            at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:224)
            at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java)
            at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doPost(JSFUnitServletRedirector.java:46)
            at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)
            at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:224)
            at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)
            at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doGet(JSFUnitServletRedirector.java:52)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:116)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
            at java.lang.Thread.run(Thread.java:619)
            Caused by: com.gargoylesoftware.htmlunit.ScriptException: Wrapped java.lang.NullPointerException (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:513)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:961)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:135)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:172)
            at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:576)
            at com.gargoylesoftware.htmlunit.javascript.host.EventNode.jsxFunction_fireEvent(EventNode.java:334)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
            ... 66 more
            Caused by: org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10)
            at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1773)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183)
            at org.mozilla.javascript.ScriptableObject.getImpl(ScriptableObject.java:2019)
            at org.mozilla.javascript.ScriptableObject.get(ScriptableObject.java:286)
            at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:63)
            at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1616)
            at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1437)
            at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1423)
            at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3027)
            at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:437)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:507)
            ... 79 more
            Caused by: java.lang.NullPointerException
            at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.isAncestorOfEventTarget(HTMLElement.java:1420)
            at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.jsxGet_offsetHeight(HTMLElement.java:1386)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
            ... 91 more
            Inside wrapped exception:
            ======= EXCEPTION START ========
            Exception class=[org.mozilla.javascript.WrappedException]
            com.gargoylesoftware.htmlunit.ScriptException: Wrapped java.lang.NullPointerException (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:513)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:961)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:135)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:172)
            at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:576)
            at com.gargoylesoftware.htmlunit.javascript.host.EventNode.jsxFunction_fireEvent(EventNode.java:334)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
            at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:476)
            at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3330)
            at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
            at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
            at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:192)
            at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:437)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:507)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:961)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:135)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:172)
            at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:576)
            at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:916)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:921)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.doMouseEvent(HtmlElement.java:1132)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.mouseDown(HtmlElement.java:1044)
            at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:99)
            at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:76)
            at org.jboss.jsfunit.jsfsession.JSFClientSession.click(JSFClientSession.java:226)
            at com.endersys.common.NetworkModuleTest.testMenu(NetworkModuleTest.java:184)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at junit.framework.TestCase.runTest(TestCase.java:154)
            at junit.framework.TestCase.runBare(TestCase.java:127)
            at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:153)
            at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:119)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:93)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:224)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java)
            at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:101)
            at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:224)
            at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java)
            at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doPost(JSFUnitServletRedirector.java:46)
            at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)
            at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:224)
            at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)
            at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doGet(JSFUnitServletRedirector.java:52)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:116)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
            at java.lang.Thread.run(Thread.java:619)
            Caused by: org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10)
            at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1773)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183)
            at org.mozilla.javascript.ScriptableObject.getImpl(ScriptableObject.java:2019)
            at org.mozilla.javascript.ScriptableObject.get(ScriptableObject.java:286)
            at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:63)
            at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1616)
            at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1437)
            at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1423)
            at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3027)
            at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:437)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:507)
            ... 79 more
            Caused by: java.lang.NullPointerException
            at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.isAncestorOfEventTarget(HTMLElement.java:1420)
            at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.jsxGet_offsetHeight(HTMLElement.java:1386)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
            ... 91 more
            WrappedException: org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd#10)
            at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1773)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183)
            at org.mozilla.javascript.ScriptableObject.getImpl(ScriptableObject.java:2019)
            at org.mozilla.javascript.ScriptableObject.get(ScriptableObject.java:286)
            at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:63)
            at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1616)
            at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1437)
            at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1423)
            at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3027)
            at script(http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd:10)
            at script(http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree-item.js.cmd:26)
            at script(http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree.js.cmd:4)
            at script(http://localhost:8080/surgategui/a4j.res/org.ajax4jsf.framework.resource.PrototypeScript.cmd:9)
            at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:437)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:507)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:961)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:135)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:172)
            at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:576)
            at com.gargoylesoftware.htmlunit.javascript.host.EventNode.jsxFunction_fireEvent(EventNode.java:334)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
            at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:476)
            at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3330)
            at script(http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/events.js.cmd:8)
            at script(http://localhost:8080/surgategui/a4j.res/org/richfaces/renderkit/html/scripts/tree-item.js.cmd:24)
            at script(http://localhost:8080/surgategui/a4j.res/org.ajax4jsf.framework.resource.PrototypeScript.cmd:9)
            at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
            at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
            at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:192)
            at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:437)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:507)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:961)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:135)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:172)
            at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:576)
            at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:916)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:921)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.doMouseEvent(HtmlElement.java:1132)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.mouseDown(HtmlElement.java:1044)
            at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:99)
            at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:76)
            at org.jboss.jsfunit.jsfsession.JSFClientSession.click(JSFClientSession.java:226)
            at com.endersys.common.NetworkModuleTest.testMenu(NetworkModuleTest.java:184)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at junit.framework.TestCase.runTest(TestCase.java:154)
            at junit.framework.TestCase.runBare(TestCase.java:127)
            at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:153)
            at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:119)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:93)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:224)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java)
            at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:101)
            at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:224)
            at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java)
            at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doPost(JSFUnitServletRedirector.java:46)
            at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)
            at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:224)
            at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)
            at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doGet(JSFUnitServletRedirector.java:52)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:116)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
            at java.lang.Thread.run(Thread.java:619)
            Caused by: java.lang.NullPointerException
            at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.isAncestorOfEventTarget(HTMLElement.java:1420)
            at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.jsxGet_offsetHeight(HTMLElement.java:1386)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
            ... 91 more
            Inside wrapped exception:
            java.lang.NullPointerException
            at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.isAncestorOfEventTarget(HTMLElement.java:1420)
            at com.gargoylesoftware.htmlunit.javascript.host.HTMLElement.jsxGet_offsetHeight(HTMLElement.java:1386)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
            at org.mozilla.javascript.ScriptableObject.getImpl(ScriptableObject.java:2019)
            at org.mozilla.javascript.ScriptableObject.get(ScriptableObject.java:286)
            at com.gargoylesoftware.htmlunit.javascript.SimpleScriptable.get(SimpleScriptable.java:63)
            at org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java:1616)
            at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1437)
            at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1423)
            at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3027)
            at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:437)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:507)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:961)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:135)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:172)
            at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:576)
            at com.gargoylesoftware.htmlunit.javascript.host.EventNode.jsxFunction_fireEvent(EventNode.java:334)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
            at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:476)
            at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3330)
            at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2487)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
            at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
            at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:192)
            at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
            at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:162)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:472)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$6.doRun(JavaScriptEngine.java:437)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:507)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:444)
            at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:961)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeEventListeners(EventListenersContainer.java:135)
            at com.gargoylesoftware.htmlunit.javascript.host.EventListenersContainer.executeBubblingListeners(EventListenersContainer.java:172)
            at com.gargoylesoftware.htmlunit.javascript.host.Node.fireEvent(Node.java:576)
            at com.gargoylesoftware.htmlunit.html.HtmlElement$2.run(HtmlElement.java:916)
            at org.mozilla.javascript.Context.call(Context.java:515)
            at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:507)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.fireEvent(HtmlElement.java:921)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.doMouseEvent(HtmlElement.java:1132)
            at com.gargoylesoftware.htmlunit.html.HtmlElement.mouseDown(HtmlElement.java:1044)
            at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:99)
            at com.gargoylesoftware.htmlunit.html.ClickableElement.click(ClickableElement.java:76)
            at org.jboss.jsfunit.jsfsession.JSFClientSession.click(JSFClientSession.java:226)
            at com.endersys.common.NetworkModuleTest.testMenu(NetworkModuleTest.java:184)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at junit.framework.TestCase.runTest(TestCase.java:154)
            at junit.framework.TestCase.runBare(TestCase.java:127)
            at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:153)
            at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:119)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:93)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:224)
            at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java)
            at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:101)
            at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:224)
            at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java)
            at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doPost(JSFUnitServletRedirector.java:46)
            at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)
            at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:224)
            at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)
            at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doGet(JSFUnitServletRedirector.java:52)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:116)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
            at java.lang.Thread.run(Thread.java:619)
            == CALLING JAVASCRIPT ==

            function (event) {
            return __method.apply(object, [(event || window.event)].concat(args).concat($A(arguments)));
            }

            ======= EXCEPTION END ========
            == CALLING JAVASCRIPT ==

            function (event) {
            return __method.apply(object, [(event || window.event)].concat(args).concat($A(arguments)));
            }

            ======= EXCEPTION END ========


            Tnx for your help.

            • 3. Re: problem clicking elements of richfaces tree using htmlun
              Gokhan Cetin Newbie

              sorry html output didn't look good.
              I am getting the same id's as the html output Stan.xpath works correct. There is some javascript exceptions below as you see.
              Hope you can help me fix this.
              I tried to click on the rows and tables as well.
              When i click on the rows of that td cells no exception is thrown but nothing happens either.
              At first click to the first root that onselect method should invoke i think.
              At normal debugging its like that