[Webtest] Adding User Agent to

Dierk König webtest@lists.canoo.com
Tue, 7 May 2002 09:27:16 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0004_01C1F5A9.60BE31C0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Adding User Agent toHi, this would be another usage of the http-header
support, that is currently under way.
thanx for the posting
Mittie
  -----Original Message-----
  From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]On Behalf Of Mike Los
  Sent: Montag, 6. Mai 2002 19:33
  To: webtest@lists.canoo.com
  Subject: [Webtest] Adding User Agent to


  Hi,
  Please consider adding the ability to specify a user agent attribute
(e.g., userAgent) as part of the config element.
  This would allow the test to include a specific user agent string; e.g.,
<config userAgent="Mozilla/4.0"  ...>

  I believe the principal coding changes are isolated to
engine/TestConfig.java and steps/Setup.java
  I just started working with webtest so I don't know yet where a self test
might be included or how to affect any related docs.

  I've included diffs against build 222 at the end of this message.

  Thanks for considering this,
  Michael Los



  RCS file:
/repositories/cvs/public/webtest/src/com/canoo/webtest/steps/Setup.java,v
  retrieving revision 1.6
  diff -r1.6 Setup.java
  24a25,27
  >                 WebConversation wc = new WebConversation();
  >
wc.setUserAgent(context.getTestSpecification().getConfig().getUserAgent());
  >
  26c29
  <               context.setWebConversation(new WebConversation());
  ---
  >               context.setWebConversation(wc);




  $ cvs diff TestConfig.java
  Index: TestConfig.java
  ===================================================================
  RCS file:
/repositories/cvs/public/webtest/src/com/canoo/webtest/engine/TestConfig.jav
a,v
  retrieving revision 1.21
  diff -r1.21 TestConfig.java
  26a27,28
  >     private String fUserAgent = null;
  >
  375a378,387
  >     public void setUserAgent(String userAgent)
  >     {
  >         fUserAgent = userAgent;
  >     }
  >
  >     public String getUserAgent()
  >     {
  >         return fUserAgent;
  >     }
  >
  384a397
  >         map.put("userAgent", getUserAgent());


------=_NextPart_000_0004_01C1F5A9.60BE31C0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Adding User Agent to</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4807.2300" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT color=3D#0000ff size=3D2><SPAN class=3D850481907-07052002>Hi, =
this would be=20
another usage of the http-header support, that is currently under=20
way.</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff size=3D2><SPAN =
class=3D850481907-07052002>thanx for the=20
posting</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff size=3D2><SPAN=20
class=3D850481907-07052002>Mittie</SPAN></FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B>=20
  webtest-admin@lists.canoo.com =
[mailto:webtest-admin@lists.canoo.com]<B>On=20
  Behalf Of </B>Mike Los<BR><B>Sent:</B> Montag, 6. Mai 2002 =
19:33<BR><B>To:</B>=20
  webtest@lists.canoo.com<BR><B>Subject:</B> [Webtest] Adding User Agent =

  to<BR><BR></FONT></DIV><!-- Converted from text/rtf format -->
  <P><FONT face=3DArial size=3D2>Hi,</FONT> <BR><FONT face=3DArial =
size=3D2>Please=20
  consider adding the ability to specify a user agent attribute (e.g.,=20
  userAgent) as part of the config element.</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>This would allow the test to include a specific user agent =
string;=20
  e.g.,&nbsp; &lt;config userAgent=3D"Mozilla/4.0"&nbsp; ...&gt;</FONT> =
</P>
  <P><FONT face=3DArial size=3D2>I believe the principal coding changes =
are isolated=20
  to engine/TestConfig.java and steps/Setup.java</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>I just started working with webtest so I don't know yet where =
a self=20
  test might be included or how to affect any related docs.</FONT></P>
  <P><FONT face=3DArial size=3D2>I've included diffs against build 222 =
at the end of=20
  this message.</FONT> </P>
  <P><FONT face=3DArial size=3D2>Thanks for considering this,</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>Michael Los</FONT> </P><BR>
  <P><FONT face=3DArial size=3D2>RCS file:=20
  =
/repositories/cvs/public/webtest/src/com/canoo/webtest/steps/Setup.java,v=
</FONT>=20
  <BR><FONT face=3DArial size=3D2>retrieving revision 1.6</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>diff -r1.6 Setup.java</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>24a25,27</FONT> <BR><FONT face=3DArial=20
  =
size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  WebConversation wc =3D new WebConversation();</FONT> <BR><FONT =
face=3DArial=20
  =
size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  =
wc.setUserAgent(context.getTestSpecification().getConfig().getUserAgent()=
);</FONT>=20
  <BR><FONT face=3DArial size=3D2>&gt;</FONT> <BR><FONT face=3DArial=20
  size=3D2>26c29</FONT> <BR><FONT face=3DArial=20
  =
size=3D2>&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;=20
  context.setWebConversation(new WebConversation());</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>---</FONT> <BR><FONT face=3DArial=20
  =
size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;=20
  context.setWebConversation(wc);</FONT> </P><BR><BR>
  <P><FONT face=3DArial size=3D2>$ cvs diff TestConfig.java</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>Index: TestConfig.java</FONT> <BR><FONT =
face=3DArial=20
  =
size=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT>=20
  <BR><FONT face=3DArial size=3D2>RCS file:=20
  =
/repositories/cvs/public/webtest/src/com/canoo/webtest/engine/TestConfig.=
java,v</FONT>=20
  <BR><FONT face=3DArial size=3D2>retrieving revision 1.21</FONT> =
<BR><FONT=20
  face=3DArial size=3D2>diff -r1.21 TestConfig.java</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>26a27,28</FONT> <BR><FONT face=3DArial=20
  size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; private String fUserAgent =3D =
null;</FONT>=20
  <BR><FONT face=3DArial size=3D2>&gt;</FONT> <BR><FONT face=3DArial=20
  size=3D2>375a378,387</FONT> <BR><FONT face=3DArial=20
  size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; public void setUserAgent(String=20
  userAgent)</FONT> <BR><FONT face=3DArial =
size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;=20
  {</FONT> <BR><FONT face=3DArial=20
  size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
fUserAgent =3D=20
  userAgent;</FONT> <BR><FONT face=3DArial =
size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;=20
  }</FONT> <BR><FONT face=3DArial size=3D2>&gt;</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; public String =
getUserAgent()</FONT>=20
  <BR><FONT face=3DArial size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp; {</FONT> =
<BR><FONT=20
  face=3DArial =
size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return=20
  fUserAgent;</FONT> <BR><FONT face=3DArial =
size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;=20
  }</FONT> <BR><FONT face=3DArial size=3D2>&gt;</FONT> <BR><FONT =
face=3DArial=20
  size=3D2>384a397</FONT> <BR><FONT face=3DArial=20
  size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
  map.put("userAgent", getUserAgent());</FONT> =
</P></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0004_01C1F5A9.60BE31C0--