18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Javascript illegal character error

yellowg555yellowg555 Members
edited November -1 in Sahi - Open Source
I am trying to execute scripts and I keep coming across this error now within Sahi that says "illegal character" which happens to be shown below:

<browser>

Those few characters appear every single time I execute ANY script, and thus prevent script execution. I have restarted the computer and tried again, but come across this same error.

Any ideas/suggestions?

Comments

  • yellowg555yellowg555 Members
    edited April 2009
    This also just started happening a couple hours ago. My machine is running Vista Ultimate with IE7.
  • narayannarayan Administrators
    Anything specific in any of the included files? What version of Sahi are you using? What OS?
    If you delete the contents inside the browser tags, do you still get the error?
  • It doesn't matter which script I execute, it could be as simple as a for loop. The same result always happens - those characters are automatically injected into the first line of the script.

    I am using the latest version of sahi v2 - 2009-03-04.
  • I figured it out. It is something to do with Visual Studio 2005, although I do not know what. I save my code as a .js file and then copy/rename the file to .sah and execute the script in Sahi. This has never posed a problem before until yesterday. What is interesting is that even if I copy the code from within Visual Studio and paste it into notepad, then save the notepad document as an .sah, it still throws the error. Only after I copy the code from notepad into ANOTHER notepad document will the code execute properly.
  • Well, upon further investigation, it is something to do with VS2005, as I had created a "new website" instead of a blank project. This simple mistake is what caused these headaches for me.
  • narayannarayan Administrators
    Quite interesting! I think it could be that the encoding of the saved file was different from the operating system's default encoding.
  • Hi,

    I think it has something to do with the encoding used by your editor (in this case which happens to be visual studio). May when you copy the code from visual studio some special characters (invisible) like new line or linefeed etc may also had got copied.

    Regards,
    Pankaj.
Sign In or Register to comment.