Forum Discussion

Asya's avatar
15 years ago

Select item from Combo box

Hi

I am trying to select item in Combo box, but TestComplete doesn't recognize my selection.

I am testing application. My Combobox is defined by system as WndClass: ATL:006C2478

I added this class into Object Mapping via Add New Object Class. (pic. Object Mapping)

TestComplete is added some external properties/methods related to Combobox class such as (wItem, wItemList ...)

After that I am trying to select specific item using ClickItem ("Item1") method but system doesn't recognize my selection

ATL:006C2478.ClickItem ("Item1")

Could you please help me? What's the problem?
  • Hi Nastassia,


    The value of the WndClass property coming after "ATL:" may change. I suggest that you try adding the "ATL:*" class name to Object Mapping.


    Also, I've noticed that items in your combo are named "Item 1", "Item 2", etc., that is, the item names contain spaces. Please make sure that you are referring to the items by valid names. Plus, you can try addressing items by their indexes. Please see the "ClickItem Action (ComboBox Controls)" article for details.


    If the suggestions above do not help, please zip the entire project suite folder along with the test execution logs and send us the archive. Sending a sample application containing the target combo box would be very helpful for us too.


  • Hi, I am getting the same problem but in a slightly different way. My combo box does not get recognized by TC. I get the error Object does not exist. My combo box is defined as WndClass: ComboBox. I checked the Object Mapping options and saw that there is already a *COMBOBOX* item in the win32 controls. I tried adding a new class too named Combobox and Combobox1 and also Combobox* just to be sure.



    The thing is, TC recognizes the combobox when I go to Object Mapping window and then after I click OK, a prompt will tell me



    ---------------------------

    TestComplete

    ---------------------------

    Update settings of the currently active project with default project settings?

    ---------------------------

    Help   No   Yes   

    ---------------------------



    (prompt appears even if I did not do any changes) and click Yes  and when I  "Run the selected keyword"[for testing the combobox] it recognizes the combo box



    but If I close the application with the combox box and run the test, that's when it returns object does not exist. Why does that happen?

  • Hi Rachelle,





    To help us investigate the behavior, please zip the entire project suite folder along with the test execution logs and send us the archive. We'll look into the situation here. Also, it would be very helpful if you provided us with a video demonstrating the actions you perform before the issue appears. For example, you can use Jing, which is a free recorder.
  • Hi,



    Right now TC cannot recognize the combobox even if I use the Default properties option as I mentioned above. Here is the video of it.



    http://www.screencast.com/t/M2MyMDI3NG



     I don't have any mic as of the moment so there's no sounds. If you see the video I am wondering why the onscreen actions available for the combo box is only limited to 5. And even if I re-highlight and then RUN the test TC can't find it. This constantly happens to me on different projects when I am creating Keyword tests.



    I tried creating a new project and everything works the combo box works fine and the onscreen actions available are not limited to 5. That's the difference I see with my existing project and a new project.



    Although I could resolve this by just creating a new project. I know I am going to encounter this problem again and I do not want to resort to creating a new project all the time just to fix it. I am probably missing something why this happens to me, I am still familiarizing a whole lot in TC options.



    Hope you can provide some answers on what's causing this and how do I prevent this kind of thing to happen on keyword testing.

  • Hi Rachelle,





    Thank you for the additional information.





    We have received a message from you (M0072545). We have looked into the project you attached to your post and the project attached to the message and found out that you face the same situation in both cases. Let's continue investigations in the M0072545 query.


  • Thanks David,



    I have sent additional details on that issue I hope we get to resolve this. Thanks a lot.