Question

I have a complex Wpf application with many nested element. I want to test app UI and I created a Coded UI test. Somewhere in app there is a telerik RadComboBox which I want to change it's selected item. The test always fails when it tries to change comboBox selected item. It throws this exception:

Test method CodedUITestProject2.CodedUITest1.CodedUITestMethod1 threw exception: Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnBlockedControlExcepti on: Another control is blocking the control. Please make the blocked control visible and retry the action. Additional Details: TechnologyName: 'UIA' FrameworkId: 'WPF' ControlType: 'ComboBox'

Xaml code is as following:

<telerik:RadComboBox Height="{StaticResource ResourceKey=defaultHeight}" Margin="{StaticResource ResourceKey=DefaultMargin}" Name="serverName" DropDownOpened="serverName_DropDownOpened"
              Grid.Column="1" IsEditable="True" TextBoxBase.TextChanged="serverName_TextChanged">
            <telerik:RadComboBox.Items>
                <ComboBoxItem>
                    <TextBlock FontStyle="Italic" Foreground="Gray" text="sqlconnection"/>
                </ComboBoxItem>
            </telerik:RadComboBox.Items>
</telerik:RadComboBox>

I don't understand why this happens.

How can I solve this?
Any answer appreciated.

Was it helpful?

Solution

Assuming that the combobox isn't hidden, as the message states, have you added the Telerik UI assembly? Seems like the MS Coded UI engine is having trouble interacting with the control specified.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top