Works like a charm.

Thanks

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Marc Guillemot
Sent: Monday, July 30, 2007 11:16 AM
To: [email protected]
Subject: [Webtest] RE: issue with embedded javascript


Have you the possibility to change the code this way:
 window.onbeforeprint = function()
instead of
 function window.onbeforeprint()
and the same with onafterprint

This does exactly the same but in a standard compliant way. Indeed I
think
that this is this non standard declaration style accepted by IE that
causes
problem when read as standard ECMA script.

Marc.


Luke.Templin wrote:
> 
> I'm not getting any errors in IE 6. The app doesn't work with Firefox
> because of specific code that's specific to IE. 
> The problem javascript is narrowed down to these three functions:
> 
> //            function printForm()
> //            {
> //                  ShowPrintableView();
> //            }
>             
> //            function window.onbeforeprint()
> //            {
> //
> document.all["divMainBanner"].style.visibility="hidden";
> //
> document.all["divToolbar"].style.visibility="hidden";          
> //            }
> //            
> //            function window.onafterprint() {
> //                 //after printing is done, set the close button
> //
> document.all["divMainBanner"].style.visibility="visible";
> //
> document.all["divToolbar"].style.visibility="visible";
> //            }
> 
> The ShowPrintableView() function is:
> function ShowPrintableView() 
>         {     
>                   var sHTML = "<html><head><style type='text/css'> " +
>                                   " .HEADERROW  { FONT-WEIGHT: bold;
> COLOR: white; BACKGROUND-COLOR: steelblue; align: left; FONT-SIZE:
8pt;
> FONT-FAMILY: Verdana; } " + 
>                                   " body { Zoom:63%; BACKGROUND-COLOR:
> white; } " +
>                         " a { text-decoration:none;cursor:
> default;color: black;FONT-WEIGHT: 700; } " +
>                                   " .Link_noPrint, .CELL_noPrint
> {display:none;} " +
>                                   " textarea { overflow:hidden; } " +
>                                   " th.locked, .noprint,
> ..CELL_noPrint, .Link_noPrint, div.tab        {display: none;} " +
>                                   " div.pageTitle span.title {
> text-align: center;FONT-SIZE: 14pt;  FONT-FAMILY:Verdana ;  } " +     
>                                   " div.scrollableDiv { overflow:
> visible; scroll: no;  } " +
>                         " </style> " +
>                               " <Title>Master View </Title> " +
>                                   " <\/head> " +
>                                   " <body>" +
>                                   "<center>Master
> View</center><p> " +
>                         " Date : " + document.all["txtDate"].value +
> "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ";
>             if(document.all["dgLogExport"]) sHTML +=
> document.all["dgLogExport"].outerHTML;
>             sHTML += " </body></html>";
>                        
>                       newWindow=window.open("", "_blank",
>
"top=10,height=700,width=730,status=yes,scrollbars=yes,toolbar=no,menuba
> r=yes,location=no,resizable=yes", false);
>                       newWindow.title="Master View Printable View";
>                       newdocument=newWindow.document;
>                       newdocument.write(sHTML);
>               newWindow.focus();
>               newWindow.print();
>            
>         }
> 
> When all three are commented out, the tests run fine. With any one
> included it fails
> 
> The test is:
> <invoke url=" ... " />
> <verifyTitle text="Dispatch Master View" />
> 
> The error reported is:
> missing ( before function parameters.
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Marc Guillemot
> Sent: Friday, July 27, 2007 12:56 PM
> To: [email protected]
> Subject: Re: [Webtest] issue with embedded javascript
> 
> Hi Luke,
> 
> [EMAIL PROTECTED] wrote:
>> An error is occurring frequently when testing with webtest an asp.net
>> application. The error is:
>> 
>> BUILD FAILED
>> 
>> C:\ ...DispatchReports.xml:1: JavaScript error loading page
>> http://localhost/....aspx:
>> 
>> missing ( before function parameters. (Embedded script in
>> http://localhost....aspx from (519, 35) to  (0, 0)#55),
>> 
>> Step: InvokePage at C:\DOCUME....xml:1:  with
>> (resultFilename="response_1185549532192_invoke.html",
> taskName="invoke")
>> 
>> The step involved is:
>> 
>> <invoke description="got dispatch reports" url="/....aspx" />
> 
> have you checked if you get a js error in a "normal" browser?
> 
>> I suspect the following embedded javascript code is the culprit:
>> 
>>  javascript:transfer('/....aspx')  Title="Generator-Position
>> Setup">Generator-Position Setup  
> 
> no, not possible. The error occurs while loading the page. The js in
> this href doesn't get parsed at this time.
> 
>> The problem also manifests itself as webtest not being able to
> recognize
>> the link using a clickLink step like :
>> 
>> <clickLink description="" href="javascript:transfer('/....aspx')' />
> or
>> <clickLink description="" xpath=" some valid xpath to the link " />
> 
> webtest not beeing able to recognize a link has nothing to do with js.
> Are you sure to be on the right page? What is the error message? Which
> links are found on the page?
> 
>> This may be the same issue as WT-315
> 
> I don't think so. WT-315 reports a js execution error (and no feedback
> has been provided since a few weeks) whereas you seem to encounter a
js
> syntax error.
> 
> Marc.
> 
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
> 
> -----------------------------------------
> **************************************************
> This e-mail and any of its attachments may contain Exelon
> Corporation proprietary information, which is privileged,
> confidential, or subject to copyright belonging to the Exelon
> Corporation family of Companies.
> This e-mail is intended solely for the use of the individual or
> entity to which it is addressed.  If you are not the intended
> recipient of this e-mail, you are hereby notified that any
> dissemination, distribution, copying, or action taken in relation
> to the contents of and attachments to this e-mail is strictly
> prohibited and may be unlawful.  If you have received this e-mail
> in error, please notify the sender immediately and permanently
> delete the original and any copy of this e-mail and any printout.
> Thank You.
> **************************************************
> 
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
> 
> 

-- 
View this message in context:
http://www.nabble.com/issue-with-embedded-javascript-tf4158732.html#a118
65653
Sent from the WebTest mailing list archive at Nabble.com.

_______________________________________________
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