编码的UI测试和Windows 10周年更新 [英] Coded UI Tests and the Windows 10 Anniversary Update

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

问题描述

对于我们的Windows Phone 10 UWP应用程序的测试自动化,我们尝试使用CodedUI


问题1:


单击模拟器上的按钮时遇到以下问题


测试名称: CodedUITestMethod

测试FullName: CodedUITesting。 CodedUITest.CodedUITestMethod

测试来源: c:\ Users \ sh259492 \Documents\Visual Studio 2013 \Projects \\ \\ CodedUITestProject1 \ CodedUITestProject1 \ CodedUITest.cs:第24行

测试结果: 失败

测试持续时间: 0:07:44.5480148



结果消息:

测试方法CodedUITesting.CodedUITest.CodedUITestMethod引发异常: 

System.ArgumentException:值不在预期范围内。

结果StackTrace:

at Microsoft.VisualStudio.TestTools.UITest.Playback.PlaybackWinrtInterfaces.IScreenElementWinrt.Tap(Int32 x,Int32 y,Boolean fEnsureVisible,Int32 nPressure)

    at Microsoft.VisualStudio.TestTools.UITest.Playback.LegacyImplementation.ScreenUIElementWinrt.Tap(Int32 x,Int32 y,Boolean ensureVisible,Int32 nPressure)

    at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement。<> c__DisplayClass3。< Tap> b__2()

    at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.ExecuteTouchAction(Action touchAction,Boolean ensureVisible)

    at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.Tap(Int32 pointX,Int32 pointY,Boolean ensureVisible)

    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl。<> c__DisplayClass8。< Tap> b__5()

    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.ExecuteAction(Action action,Action`1 remapExceptionAction,Func`1 messageOnDisabled,Boolean ensureVisible)

    at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.Tap(Point relativeTouchPoint,Boolean ensureVisible)

    at Microsoft.VisualStudio.TestTools.UITesting.Gesture.TapImplementation(UITestControl control,Point touchPoint)

    at Microsoft.VisualStudio.TestTools.UITesting.Gesture。<> c__DisplayClass2。< Tap> b _1()

    at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod [T](Func`1 function,UITestControl control,Boolean firePlaybackErrorEvent,Boolean logAsAction)

    at Microsoft.VisualStudio.TestTools.UITesting.Gesture.Tap(UITestControl control,Point relativeCoordinates)

    at Microsoft.VisualStudio.TestTools.UITesting.Gesture.Tap(UITestControl control)

   在CodedUITestProject1.UIMap.validateLastMiddleButton()

   在CodedUITesting.CodedUITest.CodedUITestMethod()



Visual Studio版本:VS Ultimate 2013 with Update 5


模拟器:移动模拟器10.0.15254.0 WVGA 4英寸512MB


问题2:


如何在通过USB连接的真实设备上运行在仿真器上运行的相同测试?





当我选择目标作为设备并运行相同的编码时面临以下问题测试


无法初始化客户端代理:无法连接到测试过程。

解决方案

嗨Didi2391,


欢迎来到MSDN论坛。


您使用 编码的UI测试项目(Windows Phone) 模板?



>>单击模拟器上的按钮时面对下面的问题


使用编码的"UI测试"构建器单击模拟器上的按钮时是否遇到问题? ?


请将目标应用程序作为独立进程运行,然后使用编码的UI测试用于记录应用程序控制的构建器。参考博客


请运行您的测试使用其他模拟器,结果如何?


< p style ="margin:0px"> 另外,你能用一个驱动器分享一个简单的样本吗?然后,我可以在我身边进行测试,更好地帮助您解决问题。



感谢您的理解与合作。


问候,


Judyzh



For Test Automation of our Windows Phone 10 UWP Applications we are trying to use CodedUI

Issue 1:

Facing below issue while Clicking a button that is there on the Emulator

Test Name: CodedUITestMethod
Test FullName: CodedUITesting.CodedUITest.CodedUITestMethod
Test Source: c:\Users\sh259492\Documents\Visual Studio 2013\Projects\CodedUITestProject1\CodedUITestProject1\CodedUITest.cs : line 24
Test Outcome: Failed
Test Duration: 0:07:44.5480148

Result Message:
Test method CodedUITesting.CodedUITest.CodedUITestMethod threw exception: 
System.ArgumentException: Value does not fall within the expected range.
Result StackTrace:
at Microsoft.VisualStudio.TestTools.UITest.Playback.PlaybackWinrtInterfaces.IScreenElementWinrt.Tap(Int32 x, Int32 y, Boolean fEnsureVisible, Int32 nPressure)
   at Microsoft.VisualStudio.TestTools.UITest.Playback.LegacyImplementation.ScreenUIElementWinrt.Tap(Int32 x, Int32 y, Boolean ensureVisible, Int32 nPressure)
   at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.<>c__DisplayClass3.<Tap>b__2()
   at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.ExecuteTouchAction(Action touchAction, Boolean ensureVisible)
   at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.Tap(Int32 pointX, Int32 pointY, Boolean ensureVisible)
   at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<>c__DisplayClass8.<Tap>b__5()
   at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.ExecuteAction(Action action, Action`1 remapExceptionAction, Func`1 messageOnDisabled, Boolean ensureVisible)
   at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.Tap(Point relativeTouchPoint, Boolean ensureVisible)
   at Microsoft.VisualStudio.TestTools.UITesting.Gesture.TapImplementation(UITestControl control, Point touchPoint)
   at Microsoft.VisualStudio.TestTools.UITesting.Gesture.<>c__DisplayClass2.<Tap>b__1()
   at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
   at Microsoft.VisualStudio.TestTools.UITesting.Gesture.Tap(UITestControl control, Point relativeCoordinates)
   at Microsoft.VisualStudio.TestTools.UITesting.Gesture.Tap(UITestControl control)
   at CodedUITestProject1.UIMap.validateLastMiddleButton()
   at CodedUITesting.CodedUITest.CodedUITestMethod()

Visual Studio Version : VS Ultimate 2013 with Update 5

Emulator : Mobile Emulator 10.0.15254.0 WVGA 4 inch 512MB

Issue 2:

How to run the same test that runs on Emulator on to a real device connected through USB ?

Facing below issue when I select target as device and run a the same codedui test

Failed to initialize client proxy: could not connect to test process .

解决方案

Hi Didi2391,

Welcome to MSDN forum.

Did you use Coded UI Test Project (Windows Phone) template?

>>Facing below issue while Clicking a button that is there on the Emulator

Did you encountered problems when you click a button on the emulator using the coded UI Test builder?

Please run your target application as a standalone process, then use coded UI test builder to record the control of your application. Reference blog "Value does not fall within the expected range" when Coded UI Test Builder generate code?

>> How to run the same test that runs on Emulator on to a real device connected through USB?

To be honest, I didn't find the official document about how to test the Windows Phone app connected through USB. I find this document describes how to set up device for development, hope could help you.

>> Failed to initialize client proxy: could not connect to test process.

Please Enable Developer Mode for Windows 10, and close all third party tools in your windows, rerun your vs as the administrator, how about the result?

I use VS 2013 update 5 to test a windows phone app reference following MSDN document, but I can’t find "Mobile Emulator 10.0.15254.0 WVGA 4 inch 512MB" in my side, how did you get it?

https://docs.microsoft.com/en-us/visualstudio/test/test-windows-phone-8-1-apps-with-coded-ui-tests

Please run your test use other Emulator, how about the result?

In addition, could you share me a simple sample using one drive? Then, I can test it in my side and better help to resolve your problem.

Thanks for your understanding and cooperation.

Regards,

Judyzh


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

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