In our application we have several comboboxes and behavior of specific one is not fine for our automation tests (Teststack.White).
Description: combobox contains two values. When application starts then visible selected value is "value1" but in code, when I call
then selectedItem is null. When I call
neither will take effect ("value1" is in combobox.Items ). I need to call
and only now is everything ok. This will not work when I have single item in combobox and this solution is not what we want to have in our app. But the strangest part is that only this one combobox is behaving as is not expected.
Do you have any idea where could be a problem? If you need more specific information, don't hesitate to ask.
Thanks and regards, Martin
5 Answers, 1 is accepted
Could you please confirm if your question is related to WPF's RadComboBox. From the provided code-snippets we notices methods like Select and SelectedItem that are not part of RadComboBox's API.
Could you share with us more details about your scenario in order for us to be able to assist you accordingly?
We are looking forward to hearing from you.
well the situation is, that we really are using RadComboBox in a project but when implementing automation tests via TestStack.White, to control RadComboBox is not just straight forward.
I'll keep looking inside the project for more information and then ask a proper question again. Or if you have experienced automation testing using White, please let me know.
Best regards, Martin
We are not using TestStack.White, but it seems like in its basics it is using the UI Automation. So as the RadComboBox supports UI Automation and have implementation of AutomatuonPeers and specifically the Selection Control Pattern the issue you are facing seems strange.
Therefore as it seems like only the initial selected item is not recognized you can try to apply some refreshing of the RadComboBox. Also you can use the UISpy tool to check if the UI Automation is aware of the SelectedItem. Another approach would be to check if the same behavior can be reproduced with the Microsoft ComboBox.
Therefore if the UI Automation recognizes the SelectedItem and the issue can be reproduced with the MS ComboBox this could point that the issues is coming from the TestStack.White. If that is not the case, it would be helpful if you can provide a simple wpf application and a simple test that would help us to reproduce the issue.
Hope this would help.
We are also facing the same issue - RadCombobox.SelectedItem returns null in spite of being selected or screen reloads. Do we have any resolution for this ?
If the suggestions provided by my colleague were not helpful in your scenario, may I ask you to share a sample project demonstrating the observed on your end behavior? This will hopefully allow us to replicate the same behavior and investigate it.
You can open a new support ticket and attach the project there, since projects cannot be added to forum posts.