[Webtest] Basic Authorization

Mikael Eriksson webtest@lists.canoo.com
Fri, 21 Mar 2003 00:19:18 +0100


Have you tried setting the username/password in the invoke step that
normally starts a testcase?

(Invoke takes those parameters but it might be that they are only useful
if it is the invoke step that triggers the authorization. Anyway, the invoke
code might be useful to look at. )

Regards
/Mikael


At 14:03 2003-03-20 -0800, you wrote:
>Hello,
>
>I am trying to use the clicklink on a link that requires basic 
>authorization.  I noticed that this doesn't work with canoo webtest.  This 
>is the code that I can use to do it with :
>
>WebRequest request = link.getRequest();
>byte[] basicAuth =
>com.sun.mail.util.BASE64EncoderStream.encode(("BASIC 
>"+username+":"+password).getBytes());
>request.setHeaderField("Authorization",new String(basicAuth));
>
>I can write this part, but I am not sure how to add the attributes to the 
>clicklink and invoke pieces.  Where in the code do I add the attributes? 
>Or is there someone else that would like to add them?
>
>
>
>Scot Hale
>
>
>
>_________________________________________________________________
>The new MSN 8: smart spam protection and 2 months FREE*
>http://join.msn.com/?page=features/junkmail
>
>_______________________________________________
>WebTest mailing list
>WebTest@lists.canoo.com
>http://lists.canoo.com/mailman/listinfo/webtest