[Webtest] Dealing with browsers?

Robert Bodziony Robert Bodziony" <robert.bodziony@gmail.com
Thu, 10 Jan 2008 13:32:18 +0100


------=_Part_5869_1964540.1199968338123
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

 hi
 using latest? build 1646 config headers works :)
  Regards,
 Robert

2008/1/10, rune@runemolden.com <rune@runemolden.com>:
>
> Hi,
>
> I really enjoy WebTest as a test framework for running browser
> simulated tests for web applications, but I have experienced some
> issues which I will address in this post.
>
> I'm trying to define a different browser than the default one, but
> this feature doesn't seem to work as expected.
> My config file is like this:
> <config
>         host="the name of the server I'm running the against"
>         port="80"
>         protocol="http"
>         basepath=""
>         summary="true"
>         saveresponse="true"
>         resultfile="${wt.resultfile}"
>         resultpath="${wt.resultpath}"
>         haltonfailure="false"
>         haltonerror="false"
>         autorefresh="true"
> >
>         <header name="User-Agent" value="Mozilla/4.0 (compatible; MSIE 6.0
> ;
> Windows NT 5.1; Hotbar 3.0)" />
>          <!-- List of User-Agents:
> http://www.user-agents.org/index.shtml?moz -->
>         <header name="accept-encoding" value="gzip,deflate" />
> </config>
>
>
> The webtest log yields the following:
> [...]
>    [webtest]  INFO (com.canoo.webtest.ant.WebtestTask) - Canoo Webtest:
> R_1551.
>     [config]  INFO (com.canoo.webtest.engine.Configuration) - Using
> browser version (Microsoft Internet Explorer, 4.0 (compatible; MSIE
> 6.0b; Windows 98), Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
> Hotbar 3.0), 1.2, 6.0). If the javascript support is not as expected,
> then it's time to go into the sources
>     [config]  INFO (com.canoo.webtest.engine.Configuration) -
> Configuring 2 HTTP header field(s)
>     [config]  INFO (com.canoo.webtest.engine.Configuration) - Skipped
> User-Agent header as it has already been configured in the
> BrowserVersion
>     [config]  INFO (com.canoo.webtest.engine.Configuration) -
> Configured header "accept-encoding": gzip,deflate
> [...]
>
> The access log on the web server says that the User-Agent field in the
> HTTP header is "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
> Hotbar 3.0)" for all requests the tests executed generate, which is
> correct according to what I declared in my <config> section.
>
> The issues I'm pointing at here is the strange logging information
> WebTest yields in the console. The logging information WebTest yields
> is very confusing and doesn't really tell what's going on. I really
> miss some good documentation concerning how to simulate different
> kinds of browser during tests, how to do this in a proper way etc.
>
> If anyone has some experience with this, please to not hesitate to
> reply on this post. I also believe the project team developing and
> documenting WebTest should develop some additional documentation on
> this topic and refactor the WebTest code in order to define less
> confusing log entries. I know that WebTest uses HtmlUnit in order to
> simulate browsers, but I still believe these issues are within the
> scope of their work.
>
> Kind regards,
> Rune
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>

------=_Part_5869_1964540.1199968338123
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

&nbsp;hi <br>&nbsp;using latest? build 1646 config headers works :)<br>&nbsp; Regards,<br>&nbsp;Robert<br><br><div><span class="gmail_quote">2008/1/10, <a href="mailto:rune@runemolden.com">rune@runemolden.com</a> &lt;<a href="mailto:rune@runemolden.com">
rune@runemolden.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>I really enjoy WebTest as a test framework for running browser
<br>simulated tests for web applications, but I have experienced some<br>issues which I will address in this post.<br><br>I&#39;m trying to define a different browser than the default one, but<br>this feature doesn&#39;t seem to work as expected.
<br>My config file is like this:<br>&lt;config<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host=&quot;the name of the server I&#39;m running the against&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;port=&quot;80&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;protocol=&quot;http&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;basepath=&quot;&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;summary=&quot;true&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;saveresponse=&quot;true&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resultfile=&quot;${wt.resultfile}&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resultpath=&quot;${wt.resultpath}&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;haltonfailure=&quot;false&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;haltonerror=&quot;false&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;autorefresh=&quot;true&quot;<br>&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;header name=&quot;User-Agent&quot; value=&quot;Mozilla/4.0 (compatible; MSIE 6.0;<br>Windows NT 5.1; Hotbar 3.0)&quot; /&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- List of User-Agents:<br><a href="http://www.user-agents.org/index.shtml?moz">http://www.user-agents.org/index.shtml?moz</a> --&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;header name=&quot;accept-encoding&quot; value=&quot;gzip,deflate&quot; /&gt;
<br>&lt;/config&gt;<br><br><br>The webtest log yields the following:<br>[...]<br>&nbsp;&nbsp; [webtest]&nbsp;&nbsp;INFO (com.canoo.webtest.ant.WebtestTask) - Canoo Webtest: R_1551.<br>&nbsp;&nbsp;&nbsp;&nbsp;[config]&nbsp;&nbsp;INFO (com.canoo.webtest.engine.Configuration
) - Using<br>browser version (Microsoft Internet Explorer, 4.0 (compatible; MSIE<br>6.0b; Windows 98), Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;<br>Hotbar 3.0), 1.2, 6.0). If the javascript support is not as expected,
<br>then it&#39;s time to go into the sources<br>&nbsp;&nbsp;&nbsp;&nbsp;[config]&nbsp;&nbsp;INFO (com.canoo.webtest.engine.Configuration) -<br>Configuring 2 HTTP header field(s)<br>&nbsp;&nbsp;&nbsp;&nbsp;[config]&nbsp;&nbsp;INFO (com.canoo.webtest.engine.Configuration) - Skipped
<br>User-Agent header as it has already been configured in the<br>BrowserVersion<br>&nbsp;&nbsp;&nbsp;&nbsp;[config]&nbsp;&nbsp;INFO (com.canoo.webtest.engine.Configuration) -<br>Configured header &quot;accept-encoding&quot;: gzip,deflate<br>[...]<br>
<br>The access log on the web server says that the User-Agent field in the<br>HTTP header is &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;<br>Hotbar 3.0)&quot; for all requests the tests executed generate, which is
<br>correct according to what I declared in my &lt;config&gt; section.<br><br>The issues I&#39;m pointing at here is the strange logging information<br>WebTest yields in the console. The logging information WebTest yields
<br>is very confusing and doesn&#39;t really tell what&#39;s going on. I really<br>miss some good documentation concerning how to simulate different<br>kinds of browser during tests, how to do this in a proper way etc.<br>
<br>If anyone has some experience with this, please to not hesitate to<br>reply on this post. I also believe the project team developing and<br>documenting WebTest should develop some additional documentation on<br>this topic and refactor the WebTest code in order to define less
<br>confusing log entries. I know that WebTest uses HtmlUnit in order to<br>simulate browsers, but I still believe these issues are within the<br>scope of their work.<br><br>Kind regards,<br>Rune<br><br>_______________________________________________
<br>WebTest mailing list<br><a href="mailto:WebTest@lists.canoo.com">WebTest@lists.canoo.com</a><br><a href="http://lists.canoo.com/mailman/listinfo/webtest">http://lists.canoo.com/mailman/listinfo/webtest</a><br></blockquote>
</div><br>

------=_Part_5869_1964540.1199968338123--