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.

//@ is not allowed

beesmanbeesman Members
edited August 2010 in Sahi - Open Source
check.js
function check(str){
        //@ lengthcheck
        var inputCheckResult = true;
        // check result
        if (inputCheckResult) {
            //the first「.」is not allowed
            if("." == str[0].substring(0, 1)){
                inputCheckResult = false;
            }
        }
}


baby.jsp
<SCRIPT type="text/javascript" src="/KissProject/js/check.js?1281402756281"></script>
<script language="javascript">
check("baby!!!");
</script>

when check() is executed, lengthcheck is undefined javascript error, and stop

Comments

  • check.js

    before://@ lengthcheck
    after: // @ lengthcheck
    function check(str){
            // @ lengthcheck
            var inputCheckResult = true;
            // check result
            if (inputCheckResult) {
                //the first「.」is not allowed
                if("." == str[0].substring(0, 1)){
                    inputCheckResult = false;
                }
            }
    }
    


    baby.jsp
    <SCRIPT type="text/javascript" src="/KissProject/js/check.js?1281402756281"></script>
    <script language="javascript">
    check("baby!!!");
    </script>
    

    when check() is executed, no error occurs
  • narayannarayan Administrators
    Hi Beesman,

    //@ seems to work fine. Does your web application do any preprocessing of pages? One way to check would be to look at the source code as seen on the browser, using firebug or some such tool.

    Regards,
    Narayan
  • in version 0611
    //@ is OK

    in version 0806
    //@ will cause javascript error
  • it works fine. there is no problem
  • beesmanbeesman Members
    edited August 2010
    test.jsp
    <%@ page contentType="text/html; charset=Windows-31J" pageEncoding="windows-31j"%>
    
    <html>
    <script language="javascript">
    </script>
    <head>
        <META http-equiv="Content-Type" content="text/html; charset=windows-31j">
        <title>index</title>
    <script language="javascript">
      function maximizeIE(){
          //@ baby
         var iner = '<object id=max classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11"><param name="Command" value="Maximize"></object>';
         if(document.getElementById("max") == null){
             document.getElementsByName('btnKiss')[0].outerHTML += iner;
         }
         max.Click();
      }
    </script>
        
    </head>
    <body>
        <table>
           <tr>
               <td><strong>sahi test</strong></td>
               <td> <input type=button value="Maximize" onclick=maximizeIE()>  
                     <input type="hidden" name="btnKiss" value="dsfasdfdsf">
                </td>
           </tr>
        </table>
    </body>
    </html>
    
    


    every body could try this jsp
    when you play back you will get error baby is undefined



    XP+IE8+sahi20100820
Sign In or Register to comment.