Reputation: 63
I am doing automation for a desktop winform application and I want to select from a combobox , I dont know why but is recognized as a WinList instead of a standard combobox. codedui opens the list by clicking the button near it but can not select an item, getting error for it. Here is the recorded code for the UI element
WinButton uIOpenButton = this.UIProMANAGEWindow.UIProductionReportWindow.UICbReportComboBox.UIOpenButton;
WinList uIItemList = this.UIItemWindow.UIItemClient.UIItemList;
#endregion
// Click 'Open' button
Mouse.Click(uIOpenButton, new Point(9, 9));
// Select '' in list box
uIItemList.SelectedItemsAsString = this.URFSelectReportParams.UIItemListSelectedItemsAsString;
Here is the exception I am getting
Message: Test method CodedUITestProject2.Raporlar_URF1.CodedUITestMethod1 threw exception: Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnBlockedControlException: Another control is blocking the control. Please make the blocked control visible and retry the action. Additional Details: TechnologyName: 'MSAA'ControlType: 'List' ---> System.Runtime.InteropServices.COMException: HRESULT özel durum döndürdü: 0xF004F003
Upvotes: 0
Views: 127
Reputation: 46
After the WinList
opens ,you need to check the properties of the control that opens. It might most certainly be Wincustom
and in it there would be WinListItem
.
You have to create these controls and then click the Winlistitem
you want using Mouse.Click()
.
Upvotes: 1