Hi,

You should try to update to 1.4.1.

Regards,

Julien

----- Message d'origine ----
De : Moen Endre <[EMAIL PROTECTED]>
À : jwebunit-users@lists.sourceforge.net
Envoyé le : Mardi, 5 Février 2008, 10h12mn 55s
Objet : [JWebUnit-users] proxy in TestContext

proxy in TestContext


 
 




Hi,



I have a test like this (the point is the proxy settings):

public class GoogleBrowseTest extends WebTestCase {

    public void setUp() {

        setTestingEngineKey( TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT );

        getTestContext().setBaseUrl( "http://www.google.com"; );



        TestContext ctx = this.getTestContext();

        ctx.setProxyPort( 88 );

        ctx.setProxyName( "proxy" );

    }

    public void testSearch() throws Exception {

        beginAt( "/" );

        setTextField( "q", "htmlunit" );

        submit( "btnG" );

    }

}

but the proxy settings in net.sourceforge.jwebunit.TestContext is never applied 
and I dont get a connection to google.



In  net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog.beginAt(String initialURL, 
TestContext context) you call initWebClient() and here you create a 
com.gargoylesoftware.htmlunit.WebClient (from the htmlUnit project) with

wc = new WebClient(new BrowserVersion(BrowserVersion.INTERNET_EXPLORER,

      "4.0", testContext.getUserAgent(), "1.2", 6));



but to apply the proxy settings from TestContext you should call the other 
WebClient constructor like this:

wc = new WebClient(new BrowserVersion(BrowserVersion.INTERNET_EXPLORER,

      "4.0", testContext.getUserAgent(), "1.2", 6), testContext.getProxyName, 
testContext.getProxyPort);



Please let me know if I am wrong or have misunderstood. By the way I am not 
comfortable with the alternative approach when building with maven of setting 
the proxy settings inside the System class like described here:

http://www.it-eye.nl/weblog/2005/07/07/jwebunit-untrusted-certificates-https-and-proxies/



This is the version of jwebunit im using:

        <dependency>

          <groupId>net.sourceforge.jwebunit</groupId>

          <artifactId>jwebunit-htmlunit-plugin</artifactId>

          <version>1.3</version>

          <scope>test</scope>

        </dependency>



-Endre







-----La pièce jointe correspondante suit-----

-------------------------------------------------------------------------
This 
SF.net 
email 
is 
sponsored 
by: 
Microsoft
Defy 
all 
challenges. 
Microsoft(R) 
Visual 
Studio 
2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/


-----La pièce jointe correspondante suit-----

_______________________________________________
JWebUnit-users 
mailing 
list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users







      
_____________________________________________________________________________ 
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 
http://mail.yahoo.fr
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to