编码的UI自动化框架不会捕获ComboBox的选定显示文本 [英] Coded UI automation framework does not captures the selected display text of ComboBox

查看:99
本文介绍了编码的UI自动化框架不会捕获ComboBox的选定显示文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果组合框是绑定到对象集合的数据,则编码的UI不会捕获WPF组合框的选定显示文本。



而是捕获集合项类名字总是。



情景 -  



我有一个具有物业名称和身份证号码的员工我有数据将我的组合框的ItemSource绑定到可观察的Employee集合,DisplayText设置为Name。



当我在下拉列表中选择文本时Scott  CodedUI将SelectedItem捕获为Employee(类名)并且它不捕获实际选择的名称。 
$


如何修复它?



谢谢。

解决方案


编码的UI无法捕获如果组合框是绑定到对象集合的数据,则选择WPF组合框的显示文本。


相反,它总是捕获集合项类名。


场景 -  


我有一个带有Property Name和Id的Employee类,我有数据将我的组合框的ItemSource绑定到可观察的Employee集合,DisplayText设置为Name。 / p>

当我选择文字Scott下拉时  CodedUI将SelectedItem捕获为Employee(类名),它不捕获实际选择的名称。 


如何解决这个问题?


感谢。


Coded UI does not captures the selected display text of WPF combobox if the combobox is data bound to a collection of object.

Instead it captures the collection item class name always .

Scenario - 

I have a class Employee with Property Name and Id and i have data bound the ItemSource of my combo box to the observable collection of Employee with DisplayText set to Name.

When i select the text Scott in drop down  the CodedUI captures the SelectedItem as Employee(Class Name) and it does not captures the actual selected name. 

How can this be fixed ?

Thanks.

解决方案

Coded UI does not captures the selected display text of WPF combobox if the combobox is data bound to a collection of object.

Instead it captures the collection item class name always .

Scenario - 

I have a class Employee with Property Name and Id and i have data bound the ItemSource of my combo box to the observable collection of Employee with DisplayText set to Name.

When i select the text Scott in drop down  the CodedUI captures the SelectedItem as Employee(Class Name) and it does not captures the actual selected name. 

How can this be fixed ?

Thanks.


这篇关于编码的UI自动化框架不会捕获ComboBox的选定显示文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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