Forum Discussion
Are you getting an error in the TestComplete log? If so, what does it say? It's hard to identify what the problem is from your description. It might help to see what the Object Spy shows when you select the listbox.
There is probably a different approach to interacting with the control that will work for you. We just need to gather a little more info first. A screen capture of the actual listbox might help too.
- Vault76er2 months agoOccasional Contributor
Attached is a screenshot of one such control. When recording, I select the dropdown arrow, it reveals the list, then I select "Male", which then populates the field, and I then move on to the next field. I've tried other methods like selecting the text area first, using typeahead, they don't seem to work either.
The logged error is "Unable to find the object ClickItem("Male"). I get a similar error for all listboxes, it gives that error and names the object the value I had selected when recording.
The name mapping is: NameMapping.Sys.ris.MainShell.pvMainPageView.RadPageViewPage.ScheduleOrder.radSplitContainer1.splitPanel1.pnlContentPanel.radPageView1.pagePatient.patientGeneral1.radGroupBox1.cmbGender
Thanks for looking at this with me!
- JDR25002 months agoFrequent Contributor
That's very helpful. ClickItem works with most combo/list box controls but not all of them. You can usually tell if it is, or is not, going to work by using the Object Spy on the combo box control like I've done below.
My example is from Notepad. As you can see, Test Complete is able to identify the list items for the combo and shows them in the wItemList property field. If you can't see yours (e.g. Female, Unknown, etc.) there when you select the combo box with the Object Spy then ClickItem is not likely to work.
This can typically be worked around by essentially splitting the ClickItem action into two or more component steps. The first step is to display the list by clicking in the combo box. Once the list is displayed the second step is to click the item you want.
Below is an example taken from our application. The combo box doesn't show any of the list items in a wItemList property. Consequently, just like your situation, ClickItem doesn't work with it.
To select the "(All Columns)" item I would do this:
Aliases.Sys.Ezp.Session.toolbar.tbDbBrowser.tbView.cboConfig.Click
Aliases.Sys.Ezp.popupMenu.dropdownBCG.ListItem("(All Columns)").ClickIf that approach doesn't work there, are other options.
Just to be clear, did you try the Keys method like this:
NameMapping.Sys.ris.MainShell.pvMainPageView.RadPageViewPage.ScheduleOrder.radSplitContainer1.splitPanel1.pnlContentPanel.radPageView1.pagePatient.patientGeneral1.radGroupBox1.cmbGender.Keys("ma")
In a lot of combo box controls that would select "Male".
- Vault76er2 months agoOccasional Contributor
I think you're on to something there. I've tried, but unsuccessfully, to add an extra step to the test to click the listbox, followed by a step to choose a value for the listbox. I am able to see in playback that the listbox gets selected, but no luck yet with making it choose a value from the list. I don't know if I'll get a chance to try again today, but will work with this more tomorrow, thanks!
- rraghvani2 months agoChampion Level 3
Is this your first time using TestComplete? What version are you using? Are you using Keyword Tests or Scripting?
The name mapping that you have provided NameMapping.Sys.ris.MainShell.pvMainPageView.RadPageViewPage.ScheduleOrder.radSplitContainer1.splitPanel1.pnlContentPanel.radPageView1.pagePatient.patientGeneral1.radGroupBox1.cmbGender is TestComplete able to identify each of the objects e.g.
Sys.ris
Sys.ris.MainShell
Sys.ris.MainShell.pvMainPageView
...and so on
- Vault76er2 months agoOccasional Contributor
First timer. version is Version: 15.67.1.7 x64. I'm using keyword tests for the time being, trying to get familiar with the product. I want to move to scripting though, once I'm comfortable with keywords.
I'm following through a course on Udemy, but struggling with it a bit because there are a lot of differences between what's being demonstrated and what's actually in front of me. The version in the course is 12.something, and is an unspecified license level though, Smartbear seems to have broken the product down into all kinds off upsell add-ons, so I could be missing functionality too.
Related Content
- 12 months ago
Recent Discussions
- 20 hours ago