绑定到.cs时如何为组合框设置SelectItem [英] How to set SelectItem for combobox when it binded to .cs

查看:99
本文介绍了绑定到.cs时如何为组合框设置SelectItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专家

在AUT中,组合框selectedutem与.cs文件绑定,我无法使用编码的UI测试"构建器在组合框的selecteditem属性中看到选定的特定项目.我想设置组合框值,并且我不想使用selectindex属性.有什么办法吗 在无法直接访问的情况下,可以在其中设置SelectedItem属性.

In AUT, combobox selectedutem is binded with .cs file, I can't see the specific item selected in selecteditem property of combobox using Coded UI Test builder. I want to set Combobox value and I don't want to use selectindex property. Is there any way where I can set the SelectedItem property in case where it's not accessible directly.

预先感谢.

推荐答案

Testuser312,

Hi Testuser312,

>> combobox selectedutem与.cs文件绑定.

>>combobox selectedutem is binded with .cs file.

您真的测试了哪种类型的应用程序?您能否分享给我有关您要测试的实际UI和控件的屏幕截图?

Which kind of app did you really test? Could you share me a screen shot about the real UI and controls you want to test?

>>我想设置Combobox值,并且我不想使用selectindex属性.有什么方法可以设置SelectedItem属性,以防无法直接访问它.

>>I want to set Combobox value and I don't want to use selectindex property. Is there any way where I can set the SelectedItem property in case where it's not accessible directly.

通常,由于这些项目在用户界面中不可见,因此要真正测试该值,我们需要在自定义代码下使用SelectedItem/selectindex属性.

Generally since the items are not visible in the UI, so to really test the value, we need to use the SelectedItem/selectindex property under custom code.

Control.SetProperty("SelectedItem","write name of the item");

Control.SetProperty("SelectedIndex",写入索引" ;);

Control.SetProperty("SelectedIndex","write index");

参考:

但是,如果您真的想在自己的身边使用这些属性,也许您可​​以 提交此功能请求: http://visualstudio.uservoice.com/forums/121579-visual-studio .
Visual Studio产品团队正在那里聆听用户的声音.

But if you really want to use these property in your side, maybe you could submit this feature request: http://visualstudio.uservoice.com/forums/121579-visual-studio.
The Visual Studio product team is listening to user voice there.

最好的问候,

Jack


这篇关于绑定到.cs时如何为组合框设置SelectItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆