I tried that, but it doesn't do anything. Basically the page preloads
content on the next page before opening it. 

 

On the page, here's the important code which preloads the page and
redirects once it is loaded (it basically submits a form once it's
loaded):

 

                

                <script type="text/javascript" language="javascript">

                                function launchDoOnLoad() {

 
dialogs.modal.open("SFX_waiting_modal");

                                                //ddui.preload();

 
document.getElementById("MainForm").submit();

                                }                              

                </script>

</head>

<body onload="launchDoOnLoad();"

                                                class="sfx_icon
sfx_header_curved sfx_headerButtons_hide
sfx_headerNavBar_hidesfx_no_icon sfx_layout_wide
sfx_secondaryArea_hide">

                

                <form id="MainForm" name="MainForm" method="post"
action="/apps/autoquoteapply/execute.do?applicationName=Auto&city=Chicag
o&effectiveDate=20091008&endEffectiveDate=20091107&postalCode=60630&prod
uctId=PLJ37454G00&regionalOffice=01&stateAbbreviation=IL&orderScoreIndic
ator=true">

                                

 

Webtest doesn't actually execute this code for some reason.

 

 

 

 

From: Ali, Haneef [mailto:[email protected]] 
Sent: Thursday, October 08, 2009 4:51 PM
To: [email protected]; Alex Ignatov; [email protected]
Subject: RE: JavaScript error...

 

Just do a sleep and then test it

   <sleep  seconds="10" description="10 second sleep" />

 

 

Haneef

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Alex Ignatov
Sent: Thursday, October 08, 2009 2:26 PM
To: Alex Ignatov; [email protected]
Subject: [Webtest] RE: JavaScript error...

 

Another error...

I was able to fix the problem using this code in the config:

                        <config>

                        <option name="ThrowExceptionOnScriptError"
value="false"/>

                                </config>

However, when I click on the button I get a "Please Wait" screen which
comes up while the page is loading. The 'resulting page' of the button
click is just the "Please Wait" screen instead of the actual page which
loads afterwards, so Webtest can't find any of the form elements I am
trying to fill in on this page.

Anyone have  any suggestions? I tried looking through the documentation
for this and couldn't find anything.

Alex

_____________________________________________
From: Alex Ignatov
Sent: Thursday, October 08, 2009 4:01 PM
To: '[email protected]'
Subject: JavaScript error...

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
<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 <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