编码UI - 无法识别Wpfbrowser上的html控件 [英] Coded UI - Unable to identify a html controls on a Wpfbrowser

查看:266
本文介绍了编码UI - 无法识别Wpfbrowser上的html控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是CodedUI& C#。



我试图自动化一个WPF浏览器的WPF应用程序。
所以基本上,这是WPF容器里面的html内容。我创建了一个类似的示例小应用程序,并在此分享。此应用程序在wpfwindow中打开amazon.in网站。



对我来说,这看起来像CodedUI正在获得一些类似的控件,而不是正确的。



如果您正在录制和执行测试或在单独的CodedUI解决方案中手写它们,您还没有提及。



如果您正在录制它们:Be <确保你使用WPF应用程序和交互记录ns,而不是使用浏览器进行记录,然后尝试使用WPF应用程序执行测试。如果您是用手写它们的话:在编写测试时正确地创建继承树。例如,在传统的CodedUI场景中,所有其他控件继承的绝对顶级对象都是Web浏览器。在你的场景中,该对象应该是WPF对象。有可能会有一些其他窗口或各种控件是WPF应用程序的子项,而这些子控件最终会将浏览器作为孩子。


I am new to CodedUI & C#.

I am trying to automate a wpf application which has a WPF Browser. So basically, It's WPF container with html content inside. I have created a similar sample small application and shared it here. This application opens the amazon.in website within wpfwindow.

WPF Browser application

My problem is Coded UI is not able to identify the Html-Controls/elements like 'Buttons', 'Text input fields' properly.

Below, the top image is from the WPF Browser app [Link which i have shared]. Here you can see a blue square box on the top-left. The coded UI identifies that area has the Search Go button.

Bottom part of the image is of the amazon website in IE browser where coded ui is properly highliting/ identifying the Search Go button.

Does this mean i cannot automate WPFBrowser apps using Coded UI.?

Can someone please tell what to do to identify the buttons properly in coded ui

解决方案

To me this looks like CodedUI is getting some control that's similar, rather than the correct one.

You haven't mentioned if you're recording and executing tests or handwriting them in a separate CodedUI solution.

If you're recording them: Be sure that you're recording using your WPF application and interactions inside of them, rather than recording using your browser and then trying to execute tests using the WPF application

If you're writing them by hand: Be sure that you're correctly creating trees of inheritance when writing your tests. For instance, in a traditional CodedUI scenario the absolute top level object that all other controls inherit from is a web browser. In your scenario, that object should be the WPF object. There are probably going to be some other windows or various controls that are children of the WPF application which in turn will finally have the browser as a child.

这篇关于编码UI - 无法识别Wpfbrowser上的html控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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