Checkbox triggered enable/disable not working during test.

3 posts, 0 answers
  1. Stuart
    Stuart avatar
    4 posts
    Member since:
    Mar 2015

    Posted 01 May 2015 Link to this post

    We have a page that enables some controls when a checkbox is checked.   Everything looks great when recording a test to validate that the controls are enabled, however when the test is run - the checkbox shows as checked - but the controls do not show as enabled.


    Here's the javascript for enable/disable the controls:

    <input name="_ctl0:ContentMain:tabGeneral:_hiddenPerformDetection" type="hidden" id="_ctl0_ContentMain_tabGeneral__hiddenPerformDetection" value="True" />
    <script type="text/javascript">
        $(function () {        $('#_ctl0_ContentMain_tabGeneral__dataSourceIsActiveCheckBox').click(function () {            if (this.checked) {
                    $('#_ctl0_ContentMain_tabGeneral__buttonsRow').removeAttr('disabled');            }
                else {
                    $('#_ctl0_ContentMain_tabGeneral__onUsDays').attr('disabled', true);
                    $('#_ctl0_ContentMain_tabGeneral__transitDays').attr('disabled', true);
                    $('#_ctl0_ContentMain_tabGeneral__defaultPriorityDropDown').attr('disabled', true);
                    $('#_ctl0_ContentMain_tabGeneral__imageSupportEnabledCheckBox').attr('disabled', true);
                    $('#_ctl0_ContentMain_tabGeneral__itemDetectionIsEnabledCheckBox').attr('disabled', true);
                    $('#_ctl0_ContentMain_tabGeneral__buttonsRow').attr('disabled', true);            }


    Any help on getting this working would be appreciated.



  2. Stuart
    Stuart avatar
    4 posts
    Member since:
    Mar 2015

    Posted 02 May 2015 in reply to Stuart Link to this post

    Ok found my own answer by a bit of experimenting.   While recording, rather than just clicking the checkbox, made the step a Mouse 'left click'.    That checked the box and triggered the click event, whereas just a standard recording of checking the checkbox and setting the javascript onclick event did not trigger the underlying javascript.


  3. Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 06 May 2015 Link to this post

    Hello Stuart,

    I am happy to hear that you have found a solution.

    Please let us know if you need further assistance.

    Boyan Boev
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top