Hi,

I've done modification suggested by Eve and uploaded a SNAPSHOT bundle here: 
http://www.gigasize.com/get.php?d=lqhopt300zb

I'm a bit affraid of the possible consequences on the existing test cases of 
other JWebUnit users so I think it will require more work to make the change 
optional.

BTW please tell me if it works for your needs.

Regards,

Julien




________________________________
De : Eve Sun <eve...@gmail.com>
À : Usage problems for JWebUnit <jwebunit-users@lists.sourceforge.net>
Envoyé le : Mardi, 7 Juillet 2009, 22h51mn 54s
Objet : Re: [JWebUnit-users] Re : NicelyResynchronizingAjaxController support 
in jWebUnit ?


Well, I've made modifications of WebUnit for our Ajax rich web testing since 
WebUnit release 1.5.
 
It works fine with JWebUnit 2.1.
 
   public void beginAt(URL initialURL, TestContext context)
            throws TestingEngineResponseException {
        this.setTestContext(context);
        initWebClient();

        /** begin of modification */
       wc.setAjaxController(new NicelyResynchronizingAjaxController());
        /** end of modification */
        
 

        try {
            wc.getPage(initialURL);
            win = wc.getCurrentWindow(); 
            form = null;
        } catch (FailingHttpStatusCodeException aException) {
            throw new TestingEngineResponseException(
                    aException.getStatusCode(), aException);

        } catch (IOException aException) {
            throw new RuntimeException(aException);
        }
    }




On Tue, Jul 7, 2009 at 9:58 AM, GRABOWSKI, Wojciech (Wojciech) 
<wgrabow...@alcatel-lucent.com> wrote:

Julien,
> 
>I don't think I have enough knowledge to do that..
>(I'm a system tester - with basic Java knowledge only..)
>Well - it looks I'm stuck for good now.
> 
>Wojtek
>
>
________________________________
 From: Julien HENRY [mailto:henr...@yahoo.fr] 
>>Sent: Tuesday, July 07, 2009 6:50 PM 
>>
>>
>>To: Usage problems for JWebUnit
>>Subject: [JWebUnit-users] Re : NicelyResynchronizingAjaxController support in 
>>jWebUnit ?
>>
>>
>>I was actually talking about modifying internal JWebUnit code then rebuilding 
>>it and running full regression test suite to check it doesn't break current 
>>behavior.
>>
>>You may have to checkout SVN code then use Maven to build the project.
>>
>>
>>
>>
________________________________
 De : "GRABOWSKI, Wojciech (Wojciech)" <wgrabow...@alcatel-lucent.com>
>>À : Usage problems for JWebUnit <jwebunit-users@lists.sourceforge.net>
>>Envoyé le : Mardi, 7 Juillet 2009, 18h39mn 27s
>>Objet : Re: [JWebUnit-users] Re : NicelyResynchronizingAjaxController support 
>>in jWebUnit ?
>>
>>
>>Juilen,
>> 
>>Can you please give me some clue how should that be done?
>>Can this be done within jwebunit-class code (ie. the code that is used in the 
>>test itself)?
>>Or do I need some changes in jwebunit code, that I will need to rebuild after 
>>the change..
>> 
>>I just don't know how can I add the line:
>>  webClient.setAjaxController(new NicelyResynchronizingAjaxController());   
>> //to HtmlUnitTestingEngine
>>in a way that my "WebTester" instance is aware of it ?
>>Do I need to create some extending class or something ?
>> 
>>I'm doing setup this way:
>>---------------------------------------
>>public class owui_commercial extends WebTestCase {
>>    private WebTester tester;
>>   public void setUp() {
>>     try{
>>          super.setUp();
>>          tester = new WebTester();
>>          //SETTING UP TEST CONTEXT / "UserAgent"
>>>>          TestContext tc = tester.getTestContext();
>>          tc.setUserAgent("Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; 
>> rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11"); 
>>          tester.setBaseUrl(URL);
>>>>      }
>>      catch (Exception e){
>>          e.printStackTrace();
>>      }
>>    }
>>[...]
>>}
>>---------------------------------------
>>later I'm using 
>>---------------------------------------
>>        tester.beginAt("/");
>>        tester.setWorkingForm("loginForm");
>>        System.out.println("Entered given URL: "+URL);
>>>>        doSleep(2);
>>        
>>        tester.clickElementByXPath("id('loginForm:userName')");
>>        tester.setTextField("loginForm:userName", "bro1");
>>        System.out.println("ACTION: Entered username.");
>>>>        doSleep(2);
>>---------------------------------------
>> 
>>thank you for your help!
>>Wojtek
>>
>>
________________________________
 From: Julien HENRY [mailto:henr...@yahoo.fr] 
>>>Sent: Tuesday, July 07, 2009 2:16 PM
>>>To: Usage problems for JWebUnit
>>>Subject: [JWebUnit-users] Re : NicelyResynchronizingAjaxController support 
>>>in jWebUnit ?
>>>
>>>
>>>Another option would be to check if current JUnit tests are still running 
>>>fine after adding:
>>>webClient.setAjaxController(new NicelyResynchronizingAjaxController());
>>>to HtmlUnitTestingEngine
>>>
>>>If it doesn't break tests then I think we can add it for the next release.
>>>
>>>Could you please try and let me know?
>>>
>>>Regards,
>>>
>>>Julien
>>>
>>>
>>>
>>>
________________________________
 De : "GRABOWSKI, Wojciech (Wojciech)" <wgrabow...@alcatel-lucent.com>
>>>À : "jwebunit-users@lists.sourceforge.net" 
>>><jwebunit-users@lists.sourceforge.net>
>>>Envoyé le : Mardi, 7 Juillet 2009, 11h30mn 39s
>>>Objet : [JWebUnit-users] NicelyResynchronizingAjaxController support in 
>>>jWebUnit ?
>>>
>>>
>>>Hello,
>>> 
>>>I would like to ask whether there is a chance to get 
>>>"NicelyResynchronizingAjaxController" support in jWebUnit?
>>>HtmlUnit code is:
>>>------------------------------------
>>>WebClient webClient = new WebClient();
>>>webClient.setAjaxController(new NicelyResynchronizingAjaxController());
>>>------------------------------------
>>>I have already found tracker that seems to be dealing with what I'm asking 
>>>for:
>>>http://sourceforge.net/tracker/?func=detail&aid=2697234&group_id=61302&atid=497985
>>> 
>>>Do you have any knowledge when this tracker will be resolved and put into 
>>>official (or unofficial) build of jWebUnit?
>>>If that is a very distant date... is there any possibility to make some 
>>>"hack" to enable this controller in current jWebUnit 2.2 ?
>>> 
>>>My questions and requests come from:
>>>- I was using jWebUnit 2.2 successfully for IceFaces 1.7.2 enabled 
>>>application
>>>- last week our product switched to newer version of IceFaces (1.8.1) and my 
>>>jWebUnit test stopped to work
>>>- after several hours of investigating I have found that enabling 
>>>"NicelyResynchronizingAjaxController" in HtmlUnit
>>>  test (simplified version of my original jWebUnit test) makes my testing 
>>> available again with IceFaces 1.8.1
>>> 
>>>thank you in advance for your help!
>>>Wojtek Grabowski,
>>>Poland
>>>
>>
>------------------------------------------------------------------------------
>>Enter the BlackBerry Developer Challenge
>This is your chance to win up to $100,000 in prizes! For a limited time,
>vendors submitting new applications to BlackBerry App World(TM) will have
>the opportunity to enter the BlackBerry Developer Challenge. See full prize
>>details at: http://p.sf.net/sfu/blackberry
>_______________________________________________
>JWebUnit-users mailing list
>JWebUnit-users@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/jwebunit-users
>
>



      
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to