Hi,

Thanks for your quick response.

I changed to build 1646, but I can't see any difference. I guess the header part worked as it should in the build of WebTest I used previously. The log output is still the same, but the web server log says that the User-Agent field of the HTTP Request Header is equal to the one defined in the header-section of the config.xml file. So I guess the header tweaking has been working in proper way the entire way for may part, but I was fouled by the log output in the console.

I have another problem (was also a problem befor I upgraded to build 1646 of WebTest): I'm trying to run tests against a web application simulating "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)". I get the following warnings:

[clickButton] WARN (com.gargoylesoftware.htmlunit.javascript.host.Window) - window.alert("ServerComm: undefined") no alert handler installed [clickButton] WARN (com.gargoylesoftware.htmlunit.javascript.host.Window) - window.alert("fnLogin: undefined") no alert handler installed

Does this say that htmlunit is unable to handle JavaScript alert dialogs?

This exactly the same alerts I'm getting when I run Mozilla Firefox (real browser) manually, but I do not get these errors when I'm running IE 6.0 (real browser) manually.

I'm running WebTest on Ubuntu Linux 7.10 Gutsy Gibbon. I don't know if that might have any impact on how browser simulation performs.


Kind regards,
Rune

Quoting Robert Bodziony <[EMAIL PROTECTED]>:

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

2008/1/10, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:

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
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest





_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to