编码的UI测试 [英] Coded UI Testing

查看:147
本文介绍了编码的UI测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好, 


有人请帮助我使用编码用户界面(VS2017)从应用程序中获取已选择的对象。 



Girish DR


解决方案

Hi Girish,


欢迎来到MSDN论坛。


不确定您是否想在编码中从UI应用程序获取对象如果我误解了什么,请纠正我。


要在CUIT中获取相应的控制对象,我们通常使用UIMap类获取Object,如:this.UIMap.UIXXXWindow.UIXXX。 UISingleControl。在通过"生成代码"生成代码之后选项使用Coded UI Test Builder,打开UIMap.uitest,
你可以找到UI控制图并使用UIMap获得你想要的相应对象。


这种方式适用于您使用CUIT生成代码。如果你自己亲自编写测试代码,请确保你有类似的类结构,如Test Builder生成的代码,这种方式也可以工作。


此外:不确定您提到的对象是C#语言中的对象或应用程序中的UI控件。如果我们想获得应用程序的UI控件或组件,Coded UI Test Builder下面的交叉发工具可以提供帮助。



希望有所帮助。期待你的回复。如果你可以在这里分享更多细节可能会更好。


感谢您的理解。


最好的问候


兰斯


Hi All, 

Someone please help me in getting already selected object from the application using Coded UI (VS2017). 

Girish D R

解决方案

Hi Girish,

Welcome to MSDN forum.

Not sure if you mean you want to get the object from an UI application in a coding way, please correct me if i misunderstand anything.

To get the corresponding Control Object in a CUIT, we usually get the Object by using UIMap class like: this.UIMap.UIXXXWindow.UIXXX.UISingleControl. After generating code by "generate code" option using Coded UI Test Builder, open the UIMap.uitest, you can find the UI Control Map and get the corresponding Object you want by using UIMap.

This way works when you use CUIT to generate code. And if you hand-write the test code by yourself, make sure you have a similar Class Structure like generated code by Test Builder, this way also can work.

In addition: Not sure the object you mentioned is an object in C# language or a UI control in application. If we want to get the UI control or component of an app, the cross-hair tool below in Coded UI Test Builder can help.

Hope it helps. Looking forward to your reply. And it could be better if you can share more details here.

Thanks for your understanding.

Best Regards

Lance


这篇关于编码的UI测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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