-
1. Re: JavascriptTimeoutException
ssilvert Jun 13, 2008 7:30 PM (in response to bgregory)"bgregory" wrote:
Is there a way to set this timeout value?
Yup. Try:
JSFClientSession.setJavascriptTimeout()
Stan -
2. Re: JavascriptTimeoutException
bgregory Jun 13, 2008 7:47 PM (in response to bgregory)Ok, I've set the javascript timeout to 30 seconds and I still get a timeout. Its a simple form and the click() is on an h:commandButton with a hard-coded action. Normal use of the webapp takes no more than 2 seconds to navigate.
It appears to lock in the joinAll() call on the first thread - don't really understand this code yet - but working on it.
Brian -
3. Re: JavascriptTimeoutException
bgregory Jun 13, 2008 8:15 PM (in response to bgregory)I tried a simple example and apparently the rich:pickList control is to blame.
This simple form will do it:<h:form> <h:messages styleClass="formError"/> <h:panelGrid columns="2"> <h:outputText value="F1:"/> <h:inputText id="f1Input" value="#{backingBean.value}" required="true"/> <h:outputText value="F2:"/> <rich:pickList id="missionPickList" value="#{backingBean.selected}"> <f:selectItems value="#{backingBean.items}"/> </rich:pickList> </h:panelGrid> <h:panelGrid style="text-align: center" styleClass="centeredTable"> <h:panelGroup> <h:commandButton id="addButton" value="Add" action="#{backingBean.doAction}"/> <rich:spacer width="5"/> <h:commandButton id="cancelButton" value="Cancel" immediate="true" action="#{backingBean.doCancel}"/> </h:panelGroup> </h:panelGrid> </h:form>
-
4. Re: JavascriptTimeoutException
ssilvert Jun 13, 2008 8:57 PM (in response to bgregory)OK. I'll write a test for it.
Can you post your JSFUnit code? I'd like to see what you are clicking.
Stan -
5. Re: JavascriptTimeoutException
bgregory Jun 13, 2008 10:25 PM (in response to bgregory)Either of the buttons will do it:
public void testBasicNav() throws MalformedURLException, IOException, SAXException { JSFSession jsfSession = new JSFSession("/form.faces"); JSFClientSession client = jsfSession.getJSFClientSession(); JSFServerSession server = jsfSession.getJSFServerSession(); client.click("addButton"); }
-
6. Re: JavascriptTimeoutException
bgregory Jun 13, 2008 10:28 PM (in response to bgregory)Here is the backingBean:
public class BackingBean { public List<SelectItem> getItems() { List<SelectItem> list = new ArrayList<SelectItem>(); list.add(new SelectItem("One")); list.add(new SelectItem("Two")); list.add(new SelectItem("Three")); list.add(new SelectItem("Four")); list.add(new SelectItem("Five")); return list; } private String value; public String getValue() { return value; } public void setValue(String value) { this.value = value; } private List<String> selected = new ArrayList<String>(); public List<String> getSelected() { return selected; } public void setSelected(List<String> selected) { this.selected = selected; } public String doAction() { return null; } public String doCancel() { return null; } }
-
7. Re: JavascriptTimeoutException
bgregory Jun 14, 2008 1:57 PM (in response to bgregory)Ok, I'm not really sure whats going on now. I have another form page that does not contain a picklist, but has an input, a textarea, and a radio. The JTE happens when I attempt to set the first text field w/ setValue(). This field doesn't have any javascript assigned to it as far as I can tell.
-
8. Re: JavascriptTimeoutException
bgregory Jun 14, 2008 2:08 PM (in response to bgregory)Something else I've come across: When attempting to setValue() on a textarea you get the following exception:
com.gargoylesoftware.htmlunit.html.HtmlTextArea java.lang.ClassCastException: com.gargoylesoftware.htmlunit.html.HtmlTextArea at org.jboss.jsfunit.jsfsession.JSFClientSession.setValue(JSFClientSession.java:117)
-
9. Re: JavascriptTimeoutException
bgregory Jun 14, 2008 2:19 PM (in response to bgregory)It appears that the <a4j:poll> control can cause the JTE also, if the polling interval is large.
-
10. Re: JavascriptTimeoutException
ssilvert Jun 14, 2008 5:35 PM (in response to bgregory)"bgregory" wrote:
It appears that the <a4j:poll> control can cause the JTE also, if the polling interval is large.
That might explain it. I haven't been able to reproduce on my end, but I'm not using <a4j:poll>. That would make sense because HtmlUnit is probably doing a Thread.join() on the polling thread, and the polling thread never ends.
I'll look at this and the CCE as well.
Stan -
11. Re: JavascriptTimeoutException
bgregory Jun 14, 2008 5:52 PM (in response to bgregory)So you haven't been able to reproduce it with just the picklist?
-
12. Re: JavascriptTimeoutException
bgregory Jun 14, 2008 8:46 PM (in response to bgregory)BTW, Which version of richfaces are you using?
-
13. Re: JavascriptTimeoutException
ssilvert Jun 14, 2008 9:42 PM (in response to bgregory)I'm using 3.2.0. I'm running against the RichFaces demo app.
Before, I thought you were "clicking" on the picklist component itself and I got a bit sidetracked figuring out how to click each of the buttons inside the control.
I won't be able to work on this any more until Sunday afternoon or evening.
Stan -
14. Re: JavascriptTimeoutException
bgregory Jun 14, 2008 10:40 PM (in response to bgregory)Actually I wasn't expecting any responses until Monday, so thanks. :)