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.

check boxes getting unchecked while continuing to new screen

SudhakarSudhakar Members
edited November -1 in Sahi - Open Source
I am facing with a weird problem of checkboxes getting unchecked when i continue to next page.

In my app i have got 3 checkboxes representing a field(which is mandatory),i have selected all the 3 checkboxes and trying to continue to next page, when i clicked on the continue button, all the checkboxes are getting deselected and a validation error is displayed as "please select the field".

Note : I am facing this issue of checkboxes only when i record and playback the script through SAHI, when i try to select those checkboxes manually and try to continue, it works perfectly and transfers to next screen.

please let me know if anybody have faced similar type issue or help me out in catching the culprit to solve this problem.

Comments

  • narayannarayan Administrators
    Sudhakar, which browser, and which version of Sahi are you facing these problems on? Can you point to a sample page where we can reproduce this?
  • SudhakarSudhakar Members
    i am using IE and sahi_20090425.zip version of sahi.
    my app is designed in a proprietary language, i am not a having a sample page which i can reproduce the issue.
  • narayannarayan Administrators
    Sudhakar,

    Seems to be something specific here. If you can email me, or send me a private message (PM) with a sample web site, it will be useful.

    Regards,
    Narayan
  • narayannarayan Administrators
    Sudhakar,

    I think I know what the problem is. Onchange event was not getting triggered for checkboxes on IE.

    I have added code for it. Check if it gets fixed by following these instructions.

    1) Open sahi/htdocs/spr/concat.js
    2) Locate "Sahi.prototype.simulateClick"
    3) In that function, replace
        if (this.isIE() && !isRight) {
            if (el && (el.tagName == "LABEL" || (el.type && (el.type == "submit" || el.type == "button"
                || el.type == "reset" || el.type == "image"
                || el.type == "checkbox" || el.type == "radio")))) {
                return el.click();
            }
        }
    

    with
        if (this.isIE() && !isRight) {
            if (el && (el.tagName == "LABEL" || (el.type && (el.type == "submit" || el.type == "button"
                || el.type == "reset" || el.type == "image"
                || el.type == "checkbox" || el.type == "radio")))) {
                // return el.click(); // old
                el.click();
                if (el.type && (el.type == "checkbox")){
                    this.simulateChange(el);
                }
                return;
            }
        }
    

    Let me know if it fixes the issue for you.

    Regards,
    Narayan
  • SudhakarSudhakar Members
    Narayan,

    Thank you so much, Your fix worked for me.
This discussion has been closed.