-
1. Re: experiencing Timing problems
baz Oct 27, 2010 5:39 AM (in response to baz)Sorry, i have not figured out how to quote code fragments correctly:-(
But the above fragment seems readable to me.
-
2. Re: experiencing Timing problems
ssilvert Oct 27, 2010 7:17 AM (in response to baz)Hi Carsten,
It looks like maybe you have more than one active JSFSession? You can only have one JSFSession active at a time. If you want to have multiple clients then you need to have one JSFSession and then use plain HtmlUnit for the other clients.
Stan
-
3. Re: experiencing Timing problems
baz Oct 27, 2010 7:29 AM (in response to ssilvert)Hi Stan,
thanks for the fast answer.
I do not want intentionally more than one JSF-Session.
Can AJAX take place here?
This is the code for the link i am trying to click:
{code}
<h:commandLink id="contractEdit" action="#{contractSearchBean.contractEdit}" onmouseup="Richfaces.showModalPanel('processingModal')">
<h:graphicImage value="/img/icons/fongstyle/bearbeiten.gif" alt="#{messages.global_edit}" styleClass="imageButtons"/>
<f:setPropertyActionListener value="#{contractTO}" target="#{contractSearchBean.selectedContractTO}" />
<s:conversationPropagation type="nest" />
<a4j:support event="oncomplete" oncomplete="Richfaces.hideModalPanel('processingModal')" />
</h:commandLink>
{code}
-
4. Re: experiencing Timing problems
ssilvert Oct 27, 2010 7:37 AM (in response to baz)You had "server" and "server1" in your code. So that made me think you were using more than one JSFSession.
All ajax should work and react to your clicks. If you think there is a timing issue you can put some sleep statements in your code and see what happens. If sleeping fixes your problem then that may point to a bug in HtmlUnit.
Stan
-
5. Re: experiencing Timing problems
baz Oct 27, 2010 9:43 AM (in response to ssilvert)Hi Stan,
yes i am at the beginning of the learning curve to jsfUnit. I had thougt that i have to get a new server whenever the view has changed. But now i know that this is not the fact. One server Instance is enough.
no, adding a sleep statement between -1- and -2- does nothave any effect. Sometimes the test succeds sometimes it fails:-(
So, iff it is really a timing problem it occurs directly in the call (-1-) toclient.click
-
6. Re: experiencing Timing problems
baz Oct 28, 2010 2:12 AM (in response to baz)Hi ,
another example:
{code}
client.click("startpage1");
assertEquals("/fong/start.xhtml", server.getCurrentViewID());
int count = 0;
boolean tryAgain = true;
while (tryAgain && count < 100) {try {
client.click("startSearchUser");
System.out.println("######### Current Page server: " + server.getCurrentViewID());
tryAgain = false;
} catch (Exception e) {
System.out.print("######### counter: " + count++);
System.out.println(" ## Click Exception !!!!!!! " + e.toString());
}}
assertEquals("/fong/person/person_search.xhtml", server.getCurrentViewID());{code}
What it does:
- navigate to startpage
- try to navigate to User Search page
I have a seen a count of minimal 2 and maximal 43 :-(