Hi,

JWebUnit try to stay independent of the underlying testing engine (was 
HttpUnit, now it's HtmlUnit, and perhaps some day Selenium-RC). We have to 
design an unified API that can be implemented by the different testing engines.

Concerning your needs, you can use :

getServerResponse() to check headers
setScriptingEnabled() to enable/disable JavaScript
getTestContext().setProxyAuthorization(null, null, "localhost", 5555)
getTestContext().addRequestHeader("Accept-Language", 
"sl");

If something is missing, we can improve the API, feel free to post a feature 
request on sourceforge.

++

Julien

----- Message d'origine ----
De : Dragan Pazin <[EMAIL PROTECTED]>
À : jwebunit-users@lists.sourceforge.net
Envoyé le : Mardi, 6 Mars 2007, 12h09mn 40s
Objet : [JWebUnit-users] JWebUnit 1.4 access to http layer

Message

 



 decided to go from JWebUnit 1.2 to JWebUnit 
1.4, and gain a lot benefits with this.
There is one thing 
that stops me from porting all existing tests to 1.4 though: I do not know how 
to access to the http layer.

 

Here are some 
examples, that I do not know how to handle in 1.4 (from existing 
functional tests with JWebUnit 1.2)

 

// seting http 
options directly 

HttpUnitOptions.setLoggingHttpHeaders(true);

HttpUnitOptions.setScriptingEnabled(false);

 

// setting proxy for 
http conversation

getTestContext().setProxyName("localhost");
getTestContext().setProxyPort(5555);

 

// accessing Header 
fields directly

getDialog().getWebClient().getClientProperties().setAcceptCookies(true);

getDialog().getWebClient().setHeaderField("Accept-Language", 
"sl");

 

 

It is true that with 
JWebUnit 1.4 I need much less access to the http layer, but in some cases it is 
still needed.

Is there still some 
way to get to it in 1.4?

 

regards

   
Dragan

 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users







        

        
                
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to