C# 在编码的UI测试中提交组合框的SelectedItems上的值

C# 在编码的UI测试中提交组合框的SelectedItems上的值,c#,.net,combobox,params,coded-ui-tests,C#,.net,Combobox,Params,Coded Ui Tests,在编码的UI测试中,是否有可能在组合框的SelectedItem上提交变量值(声明为字符串) 例如: private const string SALUTATION = "Mr."; ... CommonMap.SalutationParams.LstEntriesSelectedItemsAsString = SALUTATION; CommonMap.Salutation(); ... 由于尝试此操作,我收到一个错误: Result Message: Test method Cod

在编码的UI测试中,是否有可能在组合框的SelectedItem上提交变量值(声明为字符串)

例如:

private const string SALUTATION = "Mr.";

...

CommonMap.SalutationParams.LstEntriesSelectedItemsAsString = SALUTATION;
CommonMap.Salutation();

...
由于尝试此操作,我收到一个错误:

Result Message: 
Test method CodedUIClassicCommon.Common.CodedUITestsCommon.CodedUIClassicCommonNeuerBenutzerWeiblich threw exception: 
Microsoft.VisualStudio.TestTools.UITest.Extension.PlaybackFailureException: Cannot perform 'SetProperty of SelectedItemsAsString with value "A.Frau/SgF"' on the control. Additional Details: 
TechnologyName:  'MSAA'
ControlType:  'List'
 ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0xF004F008
TestCleanup method CodedUIClassicCommon.Common.CodedUITestsCommon.MyTestCleanUp threw exception. Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnHiddenControlException: Microsoft.VisualStudio.TestTools.UITest.Extension.FailedToPerformActionOnHiddenControlException: Cannot perform 'Click' on the hidden control. Additional Details: 
TechnologyName:  'MSAA'
Name:  'Neu Ctrl+N'
ControlType:  'MenuItem'
 ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0xF004F002.
我在谷歌上搜索过这样一个问题,但我无法解决它

谢谢你的帮助

埃里克应该

CommonMap.SalutationParams.LstEntriesSelectedItemsAsString = SALUTATION;
在LstEntries和SelectedItemsAsString之间有一个点吗

CommonMap.SalutationParams.LstEntries.SelectedItemsAsString = SALUTATION;
您能确认您试图单击的对象实际上是可见的吗?如果您正在单击由于列表需要展开/滚动/等而隐藏的菜单项,它将抛出一个错误。这是我的第一个想法

此外,我更喜欢使用菜单项的PerformSelect,而不是重新分配值