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.

could i record additional information

beesmanbeesman Members
edited November -1 in Sahi - Open Source
hi everyone

xxxx.jsp
<form action="SahiAction.do" >
  <input name="q" type="textbox" style="width:150px;">
  <input type="hidden" name="show_as" value="topics">
  <input type="submit" value="Search">
</form>

when i input dsfdfdf the click Search button

the following script is record
_setValue(_textbox("q"), "dsfdfdf");
_click(_submit("Search"));

I want to record the script like this:
_setValue(_textbox("q"), "dsfdfdf");
_click(_submit("Search"));
//topics_SahiAction     <- here is the additional information what i want to add   hidde_value + submitAction

Comments

  • narayannarayan Administrators
    Type anything (//topics_SahiAction) in the "Evaluate Expression" box and click "Append to Script" to add it.
  • beesmanbeesman Members
    edited August 2010
    hi narayan
    I have 1000 jsp files has the same hidden . the value is Random

    login.jsp
    <input type="hidden" name="RandomId" value="RandmValuexxxxx">
    <input type="button" name="submit" onclick="checkInput("xxxxActionA.do")">

    xxxxSet.jsp
    <input type="hidden" name="RandomId" value="1333">
    <input type="button" name="submit" onclick="checkInput("xxxxActionB.do")">

    yyyy.jsp
    <input type="hidden" name="RandomId" value="13sdfdf33">
    <input type="button" name="submit" onclick="checkInput("xxxxActionC.do")">



    I want to add the additional information automatically
  • concat.js
    Sahi.prototype.getScript = function (infoAr) {
        .....
        } else if (ev == "_click") {
            cmd = "_click(" + accessor + ");";
            if(this._eval(this.addSahi(accessor)).onclick == null){
                var debugT =  this._hidden("RandomId").value +  String(this._eval(this.addSahi(accessor)).parentNode.onclick);
                if(debugT != ""){
                    this._debug(debugT);
                }
    
            }else{
                var debugT =  this._hidden("RandomId").value +  String(this._eval(this.addSahi(accessor)).onclick);    
                if(debugT != ""){
                    this._debug(debugT);
                }
            }
        } else if (ev == "_setValue") {
            ..........
        }
        .....
        return cmd;
    };
    

    when i record i will output additional information to sahi console. and copy the additional informaion
    and paste it into script file.
    could it add the additional information automatically to script file?
Sign In or Register to comment.