Hey,

I just started using webtest. I am running a demo test for State Farm on
a form on their own website: http://www.statefarm.com.

This may sound somewhat odd, but security on the computer I am using
does not allow access to any website except statefarm.com through
Webtest.

When I invoke http://www.statefarm.com using
                        <invoke url="https://statefarm.com";
description="Go to State Farm"/>
I get an error because there is a small image on the bottom of the page
which is loaded from a different website, so the result is 

"JavaScript error loading page http://www.statefarm.com/:
ReferenceError: "DisplayImg" is not defined. (script in
http://www.statefarm.com/ from (856, 32) to (856, 61)#856)"

It doesn't actually matter for the test that this happens because this
piece of JavaScript is completely irrelevant to the form I am trying to
access on the page.. However, the Invoke step fails and the test stops
running.

The only workaround I found for this is to disable Javascript before the
Invoke and enable is again after the Invoke, like so:

                        <enableJavaScript enable="false"/>
                        <invoke url="https://statefarm.com";
description="Go to State Farm"/>
                        <enableJavaScript enable="true"/>
                        <setInputField htmlid="sZip" value="60630" />
                        <clickButton htmlid="getRateQuoteGo" />


However, this causes an error in the "getRateQuoteGo" button click
because it references javascript which wasn't loaded when I invoked the
page.

Anyone know a way I can solve this? Can I somehow just ignore the
javascript ReferenceError?

Thanks,
Alex

Reply via email to