HP-UFT WPF TextBlock对象捕获 [英] HP-UFT WPF TextBlock object capture

查看:128
本文介绍了HP-UFT WPF TextBlock对象捕获的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个WPF应用程序,在该应用程序中我们必须进行自动化测试. 这对于许多组件来说都可以正常工作,但是我们很难检查使用TextBlock来显示数据的摘要页面.

I am working on a WPF application where we have to automate testing. This work fine for many components but we struggle to check a summary page where we use TextBlock to display our data.

HP工具找不到WPF TextBlock.因此,我们无法检查显示的值.

The WPF TextBlock is not found by the HP tool. Thus we cannot check the values that we display.

我们尝试了以下解决方案,但没有成功:

We tried the following solutions but without success:

  • 更改名称中的x:Name(不是最好的主意,但我们尝试了所有!)
  • TextBloc上的AutomationProperties.AutomationId
  • AutomationProperties.Name
  • 使TextBlock更具针对性
  • 此处提供的解决方案: WPF教程解决方案
  • Change x:Name in Name (not the best idea right, but we tried all!)
  • AutomationProperties.AutomationId on the TextBloc
  • AutomationProperties.Name
  • Make the TextBlock focusable
  • The solution presented here: WPF Tutorial Solution

他们都没有工作,我们目前被封锁.

None of them Worked and we are currently blocked.

有人对此有经验吗?是否有解决此问题的干净方法?

Has anyone experience with this? Is there a clean solution to solve this issue?

我们需要的是:访问TextBlock内容,特别是HP UFT Tool中的Text.

What we need: access TextBlock content, in particular Text from HP UFT Tool.

推荐答案

此处是正确的答案:-

1)打开UFT 2)在UFT中打开wfp".exe"文件并运行. (YourwpfFile.exe) 3)然后您就可以使用对象间谍识别WFP窗口.

1) Open UFT 2) Open your wfp ".exe" file in UFT and run. (YourwpfFile.exe) 3) then you can able to identify the WFP window using object spy.

这篇关于HP-UFT WPF TextBlock对象捕获的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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