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.

_click on _submit does not work

smitty1_2smitty1_2 Members
edited November -1 in Sahi - Open Source
Sahi (Build: 2011-04-04)
Firefox 3.6.16
Win7 64bit

Hi,

If you run the html attached at the bottom locally and do a
_click(_submit("Preview 2"));
or a _click() on any other submit button you will notice that nothing happens. If you just click with your mouse it works fine. Does anyone see the problem?

Kind regards

<html>
<head>
<title>Quote - Multi_container Quote Preview</title>
<script language="javascript">
<!--
function settingDraft(){
       document.forms['mainForm'].elements['setDraft'].value='1';
    alert("You are saving the proposal as Draft ? nothing will be sent to the customer!");
}
function popWarning(){
    //alert("Auto approval declined -- save as draft/approval required forced !");
}
//-->
</script>
<script language="javascript">
var moreWin = null;
var sub = null;

function openMoreWin(_s) {
    if(_s !=null){
       sub = _s;
     var content_in = document.forms['mainForm'].elements[sub].value;
      moreWin = window.open('/stage1_8080/fgdemo/quote4?action=notesWindow&search__crnt_uid_=UPTIMECT&user_uid=UPTIMECT&thisPage=preview1&basket_id=4dbf24b66a4e0000&system=fgdemo_stage&requestId=20110502152304123_0&session=4dbf24b66a4e0000_1304374974958_20f2121ecde0558b1190dc7f328fbadd&content='+content_in+'&field_name='+_s, 'moreWin', 'width=680,height=580,status=yes');
      moreWin.parentField = document.forms[0].elements[sub];
      checkWin();
    }
}

function checkWin(){
  if (sub == null){
      return false;
   } 
  if (moreWin!=null) {
    if (moreWin.loaded) { 
       // window is ready => update it and we are done
      moreWin.parentWin = this;
      updateMoreWin();
      
    } 
    // child win exists but is not ready => check back later
    else {
      window.setTimeout('checkWin()', 1000);
     }
  } else {                          // child win does not exist yet => check back later
    window.setTimeout('checkWin()', 1000);
  }
}

function updateMoreWin() {    // initialize child window once it is ready
  if (sub == '') {
     return false;
 } else{
     moreWin.insertHTML(this.document.forms[0].elements[sub].value);
     moreWin.parentField = document.forms[0].elements[sub];
     moreWin = null;
  }
}

// Facilitates QQ acceleration.  -suy, 20061128
function setAction( _whichAction ) {
    var actionElements = document.getElementsByName( "action" );
    if( actionElements.length < 1 ) {
        var newField = document.createElement( "input" );
        newField.type = "hidden";
        newField.name = "action";
        newField.value = _whichAction;
        document.forms[ 'mainForm' ].appendChild( newField );
    } else {
        actionElements[ 0 ].value = _whichAction;
    }
}

function setActionToPreview2() {
    setAction( 'set_multi_changes_2' );
}
</script>
<script language="JavaScript" type="text/javascript" src="/jsLib/util/TeTrekAutoNav.js"></script>
</head>
<body background="" bgcolor="#ffffff" link="#00318c" vlink="#003893" topmargin="0" rightmargin="0" leftmargin="0" marginheight="0" marginwidth="0" ONLOAD="window.focus();zoomPast( document.forms[ 'mainForm' ], setActionToPreview2 );"><a name="top">

<font face="arial"><!-- beginning of header.tet--><!-- stylesheet.tet -->

<!-- end of stylesheet.tet -->
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" height="60">
    <tr>
      <td width="240" height="60" BGCOLOR="#FFFFFF" align="center" valign="top"><a href="http://www.freightgate.com" target="_top"><img src="/icons/fgdemo/html/en/logo_freightgate_white.png" border="0"></a></td>
         <td BGCOLOR="#FFFFFF">&nbsp;</td>
      <td width="300" BGCOLOR="#FFFFFF" height="60">
<!--                <p align="center"><img src="/icons/fgdemo/html/en/page-tarifftrek.gif" width="250" height="30"></p>     -->
                  <p align="center"><img src="/icons/fgdemo/html/en/page-tarifftrekBGtrans.gif" border="0"></p>
      </td>

      <td BGCOLOR="#FFFFFF">&nbsp;</td>
      <td width="240" height="60" BGCOLOR="#FFFFFF" valign="top" align="right">
        <a href="" target="_top"><img src="/icons/fgdemo/html/en/logo_tarifftrek_black.gif" border="0"></a>&nbsp;</td>
    </tr>
  </table>  
  <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
    <tr>
      <td width="464" height="32" background="http://demo2.tarifftrek.com/images/tarifftrek/tab-blank.gif">&nbsp;</td>
      <td height="32" background="http://demo2.tarifftrek.com/images/tarifftrek/tab-blank.gif">&nbsp;</td>

      <td width="40" height="32" background="http://demo2.tarifftrek.com/images/tarifftrek/tab-blank.gif">&nbsp;</td>
      <td width="216" height="32" background="http://demo2.tarifftrek.com/images/tarifftrek/tab-blank.gif" align="right" nowrap><nobr><IMG src="http://demo2.tarifftrek.com/images/tarifftrek/tab-leftcap.gif" height="32" border="0"><a href="javascript:top.close();" ><IMG src="http://demo2.tarifftrek.com/images/tarifftrek/tab-close.gif" width="72" height="32" border="0"></a></nobr></td>
    </tr>
  </table>    
<!-- end of header.tet -->

<form action="/stage1_8080/fgdemo/quote4" method="post" name="mainForm">

<input type="hidden" name="search__crnt_uid_" value="UPTIMECT"><input type="hidden" name="user_uid" value="UPTIMECT"><input type="hidden" name="thisPage" value="preview1"><input type="hidden" name="basket_id" value="4dbf24b66a4e0000"><input type="hidden" name="system" value="fgdemo_stage"><input type="hidden" name="requestId" value="20110502152304123_0"><input type="hidden" name="session" value="4dbf24b66a4e0000_1304374974958_20f2121ecde0558b1190dc7f328fbadd">

    <input type="hidden" name="drayage" value="1">

<p>
<input type="hidden" name="setDraft" value="">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!-- start multi_quote_data.tet  -->

<script language="javascript">
<!--
function applyMarkuptTces(s){
    markup  = 0;
    try{
            markup_s = document.forms['mainForm'].elements['markup_tces'].value;
            if(markup_s != ''){
                markup = parseFloat(markup_s);
               }
            
            
       }catch(er){
            alert("    Sorry, markup for Transportation Cost is not a valid number!");
            return false;
      }
    
        // loop thru to update all sell_rates
        ttl_m = 0;
        _dec = 2;
        if(s=='spot'){
                do_markup_spot();
        }else{
                    do_markup_general();
        }
    return false;
}

function do_markup_spot(){
        var markup_type = document.forms['mainForm'].elements['markup_type_tces'].value;
        var _old_transportation_cost_ex_sur_s = document.forms['mainForm'].elements['old_transportation_cost_ex_sur'].value;
        var _old_transportation_cost_ex_sur = parseFloat(_old_transportation_cost_ex_sur_s);
        if(markup_type == ''){
            markup_type = document.forms['mainForm'].elements['markup_type_tces'].value;
        }
        if(markup_type.indexOf("percent")!=-1){
            ttl_m = (_old_transportation_cost_ex_sur * (100 + markup) / 100).toString();
            ttl_m = round_decimals(ttl_m,2);
                 document.forms['mainForm'].elements['transportation_cost_ex_sur'].value = ttl_m;
             
            } else if(markup_type.indexOf("dollar")!=-1){
                 ttl_m = (_old_transportation_cost_ex_sur + markup).toString();
             ttl_m = round_decimals(ttl_m,2);
            document.forms['mainForm'].elements['transportation_cost_ex_sur'].value = ttl_m;
        }
}

function do_markup_general(){
        
        var markup_type_general = document.forms['mainForm'].elements['markup_type_tces_general'].value;
        
    for(i =0; i < document.forms['mainForm'].elements.length; i++){
        if(document.forms['mainForm'].elements[i].name.indexOf("old_transportation_cost_ex_sur_") != -1){
            var _tmp_id = document.forms['mainForm'].elements[i].name.substring(document.forms['mainForm'].elements[i].name.indexOf("old_transportation_cost_ex_sur_")+31, document.forms['mainForm'].elements[i].name.length);
            var _old_transportation_cost_ex_sur_s = document.forms['mainForm'].elements['old_transportation_cost_ex_sur_'+_tmp_id].value;
            var _old_transportation_cost_ex_sur = parseFloat(_old_transportation_cost_ex_sur_s);
            //alert("It is :"+_tmp_id+" and markup is: "+markup+":"+_old_transportation_cost_ex_sur);
            if(markup_type_general.indexOf("percent")!=-1){
                ttl_m = (_old_transportation_cost_ex_sur * (100 + markup) / 100).toString();
                ttl_m = round_decimals(ttl_m,2);
                     document.forms['mainForm'].elements['transportation_cost_ex_sur_'+_tmp_id].value = ttl_m;
                   } else if(markup_type_general.indexOf("dollar")!=-1){
                     ttl_m = (_old_transportation_cost_ex_sur + markup).toString();
                 ttl_m = round_decimals(ttl_m,2);
                document.forms['mainForm'].elements['transportation_cost_ex_sur_'+_tmp_id].value = ttl_m;
            }
        } 
    }
}

function round_decimals(original_number, decimals) {
    var result1 = original_number * Math.pow(10, decimals);
    var result2 = Math.round(result1);
    var result3 = result2 / Math.pow(10, decimals);
    return pad_with_zeros(result3, decimals);
}
function pad_with_zeros(rounded_value, decimal_places) {
    var value_string = rounded_value.toString();
    var decimal_location = value_string.indexOf(".");
    // Is there a decimal point?
    if (decimal_location == -1) {
        // If no, then all decimal places will be padded with 0s
        decimal_part_length = 0;
        // If decimal_places is greater than zero, tack on a decimal point
        value_string += decimal_places > 0 ? "." : "";
    }
    else {
        // If yes, then only the extra decimal places will be padded with 0s
        decimal_part_length = value_string.length - decimal_location - 1;
    }
    
    // Calculate the number of decimal places that need to be padded with 0s
    var pad_total = decimal_places - decimal_part_length;
    
    if (pad_total > 0) {
        // Pad the string with 0s
        for (var counter = 1; counter <= pad_total; counter++) {
            value_string += "0";
        }
    }
    return value_string;
}
</script>
<tr>
<td colspan="2">
<p>
<center>
<!-- end multi_quote_data.tet  -->
<p>
    <input type="hidden" name="mode" value="save">
               <input type="hidden" name="action" value="set_multi_changes_2" />

            <input type="submit" name="submit_edit_multi_quotes" value="Edit" onClick="setAction( 'edit_multi_quotes' )">&nbsp;&nbsp;
            <input type="submit" name="submit_set_multi_changes_2" value="Preview 2" onClick="setAction( 'set_multi_changes_2' )">
</td>
</tr>
</center>
</form>
</font>
</body>
<!-- end email_multi_preview.tet  -->
</html>

Comments

  • Hi ,

    Even I am facing the same issue on IE 7.
    _click is not clicking on "close" button in the popup.

    Let me know ASAP , if any one is ware of the solution .

    Thanks
  • hi,

    I have the same problem.

    is there any solution?

    Thanks!
  • Hi hsegura,

    What version of Sahi are you using?Use the latest version and check if it solves your issue?

    Could you check if you able to click on the close button from the controller?

    Are you facing this problem on all browsers?

    Also, post the script for clicking on the close button.

    Regards
    Smrithi
Sign In or Register to comment.