Figured it out. For anyone curious when doing a replace it needs to have quotes around both parameters or htmlunit will barf.
_____ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Loehr, Ruel Sent: Tuesday, December 04, 2007 1:49 PM To: [email protected] Subject: [Webtest] javascript error - unexpected first parameter 0.0 Hey guys, I’ve encountered a new javascript error and I think I’ve nailed down the exact line, maybe some of you have some suggestions on if this is really a htmlunit bug. I’m using the nightlysnapshot from last Friday of htmlunit. The error message I get through webtest is: Error Message JavaScript error loading page file:/c:/temp/htmlunit1/test2.html: Unexpected first parameter: 0.0 Location C:\projects\esotest\WebTest\ESO\tests\createBranchNoTech.xml (line: 17) Details javascript error Unexpected first parameter: 0.0 line -1 javascript source function () { [native code, arity=0] } failing line <no source> javascript call stack Unexpected first parameter: 0.0 I’ve saved the html file locally and added a bunch of alerts to the javascript. This way, when I execute as webtest swallows the alerts I can at least see at what point of the code I am dying in. All alerts execute until I hit: alert(defaultStartTime.substring(0,2).replace(0, "")); It seems that the replace function is what is killing me. This is the actual javascript. <script type="text/javascript"> function addWorkTime(day) { alert("STARTING JAVASCRIPT"); var test = "07"; alert(test); alert(test.substring(0,2)); //this line breaks!!!! alert(test.substring(0,2).replace(0, " ")); } Any ideas? Ruel Loehr Configuration Management Pointserve, Inc. 110 Wild Basin Road Suite 300 Austin, Texas 78746 O: 512.617.5314 F: 512.617.0466 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.10 - Release Date: 11/29/2007 12:00 AM No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.10 - Release Date: 11/29/2007 12:00 AM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.10 - Release Date: 11/29/2007 12:00 AM

