Forum Discussion

co's avatar
co
New Contributor
7 years ago

ComboBoxPopupListBox.ClickItem("ComboBoxMenuItem1") does not work

Hello, I want to test an standalone desktop application, which is written in C#.

For this, I recorded some test steps and while replaying I've seen that

TestComplete can recognize UI elements like EditBox, PushButton etc. , 

but it cannot click into ComboBox object to select its items.

 

Recorded test steps are as following:

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

//Clicks at the point (178,7) of the FormElementobject.

Aliases.appX.FormElementContainingComboBoxPopUpForm.Click(178,7) ; -> pass

 

Delay(2000);

 

//Clicks the ComboBoxMenuItem1.

Aliases.appX. appXComboBoxPopupForm.ComboBoxPopUpListBox.ClickItem("ComboBoxMenuItem1"); ->FAIL

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

In the test run log:

 

Unable to find the object ClickItem("Bilinmiyor                                                                                     "). 

 

Additional Info:

 

The object with the specified attributes does not exist.

Tested object:

Aliases.hskks.HskksComboBoxPopupForm.ComboBoxPopupListBox

 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

 

In order to get rid of blank chars in ClickItem("Bilinmiyor                                                                                     "),

we used ClickItem("Bilinmiyor*"); but it does not help. 

 

I am using a trial version, so C# is not supported there; therefore I had to choose Javascript as scripting language. May this cause this object-recognition problem?

1 Reply

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    My guess is that the object Aliases.appX. appXComboBoxPopupForm.ComboBoxPopUpListBox does not support the method "ClickItem".

     

    So... next question... what happens when you try to record the desired action?  How does the code show up?  I don't recommend retaining the recorded code for your actual tests but it is useful for exploration purposes.

    I'm assuming that there is some other component as well that you initially click on to get the "ComboBoxPopupListBox"...  does that component have the "ClickItem" method?

    Finally...  the trial version should support all script code types...  C# script may not be available in the wizard but if you create a Project Suite first and then right click on the suite and select Add -> New Item, you'll get the following screen.