Forum Discussion

rushikesh's avatar
rushikesh
Contributor
6 years ago
Solved

How to select checkbox present under treeView

Hi,

Please refer attached snapshot treeView.png

Observe that tree has checkbox for each Item and to select item one need to check corresponding checkbox.

How to select such checkbox in Test Complete.

 

I tried 

TreeViewFeature.wItems.Item(0).Check()

But got Error: Invalid number of parameters.

 

If select using Items option it click on name correspoding to checkbox, which does not check the checkbox; ie selecting name of checkbox does not check checkbox. 

 

How to check such checkbox.

 

Regards,

Rushikesh Kadam

 

  • Invalid number of parameters simply means that, in your code, you haven't properly implented it.  I don't know this specific control but does the "Check" method take a boolean parameter?  What does "Object SPy" show when you try and examine the checkbox, if possible?  Have you tried recording what you're intending to do to see how TestComplete recognizes it?

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Invalid number of parameters simply means that, in your code, you haven't properly implented it.  I don't know this specific control but does the "Check" method take a boolean parameter?  What does "Object SPy" show when you try and examine the checkbox, if possible?  Have you tried recording what you're intending to do to see how TestComplete recognizes it?

    • rushikesh's avatar
      rushikesh
      Contributor

      tristaanogre 

      I checked again and found that check method does not take boolean parameters. I used "cbChecked" instead and it worked.

      Thank you for pointing it out.