This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Unable to Identify webCheckBox is checked or not

HI,

UFT -14.53

Add In used - web(Also tried with .net and wpf)

None of the properties (class, outerhtml, xpath, etc.) shows any difference between checked or unchecked  webcheckBox. This include native properties. checked status is always returning 0.

code tried: Used OR and Description.create method.

Regards

Albert Jose

 

 

  • 0

    You can use the jQuery prop() method to check or uncheck a checkbox dynamically such as on click of button or an hyperlink etc. The prop() method require jQuery 1.6 and above.

    Let's try out the following example to understand how it basically works:

    Example

    Try this code »
    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>jQuery Check/Uncheck Checkbox</title>
    <script src="">code.jquery.com/.../script>
    <script>
    $(document).ready(function(){
    $(".check").click(function(){
    $("#myCheck").prop("checked", true);
    });
    $(".uncheck").click(function(){
    $("#myCheck").prop("checked", false);
    });
    });
    </script>
    </head>
    <body>
    <p><input type="checkbox" id="myCheck"> Are you sure?</p>
    <button type="button" class="check">Yes</button>
    <button type="button" class="uncheck">No</button>
    </body>
    </html>