Forum Discussion

chrismdiaz's avatar
chrismdiaz
New Contributor
8 years ago
Solved

How can I set the property of a hidden checkbox?

I have a checkbox that I'm trying to set, but it's not visible on the screen. I've tried the call object method and setting it through a script, but I still get the same error: "There was an attempt to perform an action at point (6, 6) which is transparent or out of the window bounds."

 

Aliases.browser.pageMxMerchantDashboard.panelPpsContainer.checkboxLast4DigitsOfCardNumber.ClickChecked(false)

 

Any ideas on how to set this checkbox? 

  • Well, generally speaking, you're trying to have TestComplete use a mouse action to select an item. However, as with any mouse action, if the item cannot be accessed, then you cannot execute the action.

    Rather than using ClickChecked, you might want to see if there is a property value of the checkbox that you can set directly.  For me, this is a best practice, anyways, because when I'm running an automated test, I'm not as much interested in how well the UI behaves as I am in how the application/page functions when certain values are set.

  • ghuff2's avatar
    ghuff2
    8 years ago

    If the checkbox is an HTML input element, then you should be able to directly set the checked property. For example to check the box do this:

     

    Aliases.browser.pageMxMerchantDashboard.panelPpsContainer.checkboxLast4DigitsOfCardNumber.checked = True

    Or set the value equal to False to uncheck the box.

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Well, generally speaking, you're trying to have TestComplete use a mouse action to select an item. However, as with any mouse action, if the item cannot be accessed, then you cannot execute the action.

    Rather than using ClickChecked, you might want to see if there is a property value of the checkbox that you can set directly.  For me, this is a best practice, anyways, because when I'm running an automated test, I'm not as much interested in how well the UI behaves as I am in how the application/page functions when certain values are set.

    • ghuff2's avatar
      ghuff2
      Contributor

      If the checkbox is an HTML input element, then you should be able to directly set the checked property. For example to check the box do this:

       

      Aliases.browser.pageMxMerchantDashboard.panelPpsContainer.checkboxLast4DigitsOfCardNumber.checked = True

      Or set the value equal to False to uncheck the box.