Forum Discussion

krainevsky's avatar
krainevsky
Contributor
15 years ago

TC7.52, Delphi7, TCheckBox. How to check that item is checked?

Hi,





I have a TCheckListBox control in our application. I want to check(not to select), whatever the item is checked, but I can't find a way how to do this. I've attached the .tcObject file with all properties a have access to through the TestComplete. Any suggestions will be helpful.





Thanks in advance.

9 Replies

  • Hello David,





    My application is allready compiled with debug info and before running tests I run StripTDS for all application's modules - this way I get *.tcx files and more stable TestComplete's behavior in reading debug info same time. 

    I can see Checked property in Object Browser. Sometimes. If I don't use StripTDS. I can't find differences between application's run, but sometimes I'm able to see even more properties than it is stored in attached "RoleBox_2.zip". The attached object "rolebox_2.tcObject"  has the basic set of available properties if I don't use StripTDS. There might be more or less of them and I can't find why it is so.

    If I use StripTDS before run (as recomended in help) I see the minimum, but stable set of properties: see RoleBox.zip in attach(same as in my previous post). May be someone has the same "strange" behavior and knows, how to get the TCheckListBox  item checked property in such situation?

  • Hello Alexander,





    I suppose the problem occurs because your tested application was compiled with debug information incorrectly. Please make sure that you have compiled the application by following the instructions given in the help topic I mentioned. Pay attention to the fact that your application must be compiled without optimization.





    I have attached a simple application containing the TCheckListBox control. I was able to check whether the item is checked by using the wSelected property. Can you access this property?





    If the problem persists, please let me know what IDE was used to create your application.
  • Hi David,





    I think I've found the cause of my main problem - it's in Build with runtime packages option. If it is enabled - I can't see a lot of options in Object Browser including "State" option.





    Thanks David!
  • Sorry, my mistake read "property" instead of "option" in my previous post
  • naoya's avatar
    naoya
    New Contributor
    I have same problem.

    In the TCheckListBox, I can see only an item is selected or not through wSetected property.

    I cannot see an item is checked or not from the wSelected property or any other property.

    I downloaded an example "Project1" and tested with it.  But still I cannot see it checked or not.

    I can see only it is selected or not through wSelected property.

    I checked the TC7 help file and said it is boolean and returns only true or false.

    How can I see that an item is checked or not?

    I am using TestComplete 7.52 and Delphi 7
  • naoya's avatar
    naoya
    New Contributor
    Do you think Checkbox and CheckListbox are same?

    Have you ever used it before?


  • Hi,



    Have you tried to use the Checked property in the Object Browser? To test the control, you need to use its native properties and methods. To do this, your application should be compiled as Open. Make sure that you have compiled the application by following the instructions given in the "Open Applications in Delphi" article.