Answered

How to check if a check box is checked.

I have a test which checks "check boxes" using the Subject7 check function.   This works well, so my locators are correct.

I would like to read back the value of the check box (whether checked or not) later in the test.   Get_web_value always returns "on" whether the box is checked or not.   Any ideas on how I can read back the checkbox value?

 

0
7 comments
Avatar
Joseph Hamdan

Hi William,

Would it be possible to share a screenshot of the DOM before and after one of your checkboxes is checked/unchecked?

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
William Smith

Let me know if this isn't what you are looking for.  "Screenshot of DOM" appears to be a fairly generic operation.

0
Comment actions Permalink
Avatar
William Smith

That was a screenshot before.  Here is an after:

 

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi William,

Thanks, but what I am looking for is element in HTML, could you please inspect it and provide screenshot from Elements tab on your browser?

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
William Smith

Sure.   That I can do.   It appears to look the same no matter what.  But Subject7 seems to be able to read it to check it or uncheck it.

 

    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    --indigo: #6610f2;
    --pink: #e83e8c;
    --yellow: #ffb819;
    --cyan: #17a2b8;
    --gray-dark: #343a40;
    --black: #000;
    --gray: #616265;
    --lightgray: #b2b3b2;
    --gray91: #e8e8e8;
    --white: #fff;
    --navyblue: #14284b;
    --navybluelight: #e7e9ed;
    --navybluedark: #d0d4db;
    --purple: #6c3a77;
    --purplelight: #f0ebf1;
    --purpledark: #e2d8e4;
    --blue: #20558a;
    --bluelight: #e8eef3;
    --bluedark: #d2dde8;
    --teal: #005f71;
    --teallight: #e5eff1;
    --tealdark: #ccdfe3;
    --red: #c0143c;
    --redlight: #f9e7eb;
    --reddark: #f2d0d8;
    --green: #719500;
    --greenlight: #f1f4e5;
    --greendark: #e1e8cc;
    --orange: #e57200;
    --orangelight: #fcf1e5;
    --orangedark: #fae3cc;
    --lightblue: #5f9baf;
    --lightbluelight: #eff5f7;
    --lightbluedark: #dfebef;
    --warmyellow: #ffb819;
    --warmyellowlight: #fff8e8;
    --warmyellowdark: #fff1d1;
    --primary: #20558a;
    --secondary: #6c757d;
    --success: #719500;
    --info: #17a2b8;
    --warning: #ffb819;
    --danger: #c0143c;
    --light: #f8f9fa;
    --dark: #343a40;
    --breakpoint-xs: 0;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 992px;
    --breakpoint-xl: 1200px;
    --font-family-sans-serif: "Helvetica Neue",helvetica,arial,sans-serif;
    --font-family-monospace: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
    pointer-events: auto;
    border-collapse: separate !important;
    border-spacing: 0;
    word-wrap: break-word;
    word-break: break-word;

Before the checkbox is checked:

<input id="select0" type="checkbox" title="Select">

 

 

After the checkbox is checked:

<input id="select0" type="checkbox" title="Select">

 

0
Comment actions Permalink
Avatar
William Smith

I have found a way to do this using CSS selecters and "Verify_element" operations.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi William,

Glad you were able to find a solution. Please let us know whenever you need any help.

Thanks!

Regards,
Subject7 Team

0
Comment actions Permalink

Please sign in to leave a comment.