Forum Discussion

swatiaa's avatar
swatiaa
New Contributor
2 years ago

How to check if checkbox is checked or not where checkbox is in SPAN TAG

I m trying to check state of Checkbox which is created using span Tag.

This is span tag Declaration for unchecked Checkbox:

<span part="indicator" class="slds-checkbox_faux" lightning-input_input=""></span>

 

This is span tag Declaration for checked Checkbox:

<span part="indicator" class="slds-checkbox_faux" lightning-input_input="">::After</span>

::After- this is disabled text

  • MW_Didata's avatar
    MW_Didata
    Regular Contributor

    As for spantags i dont know what that means but,

    for my software it's a property attached to the checkbox, to know if it's checked I use an If then statement and check if property:

    Aliases.etc.etc.etc.{checkbox}.Checked equals true.

     

    If within a gid I use set variable:

    Aliases.etc.etc.etc.{Grid}.get_Item({row}, {colomn})

     

    Hope this helps

     

    • swatiaa's avatar
      swatiaa
      New Contributor

      Hi MW_Didata ,

      Actually I tried that but  those properties are not getting applied for my object. 

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I vaguely remember there was a previous post about SPAN tags, where TestComplete was not able to pickup the control within.

     

    See Web Elements Included in and Excluded From the Object HierarchyIf the Use legacy web testing features project option is enabled, SPAN elements with no text contents of their own are not included in the object hierarchy regardless of their role attribute.