HP

编程入门 行业动态 更新时间:2024-10-27 21:26:12
本文介绍了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

本文发布于:2023-10-31 02:00:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1544657.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:HP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!