我在ios上遇到以下问题。当我使用xamarin的UITest启动应用程序时,ios将显示跳板警报。它问我是否允许该应用发送消息。
有人知道如何接受这些警报吗?
完整的堆栈跟踪:
at UniversalApp.UITests.Utils.User.TapCoordinates (System.Single x, System.Single y, System.String description) [0x00006] in <f9fcfaf13de2474da4249e746e944d83>:0 at UniversalApp.UITests.Pages.PushNotifications.ApproveMessageNotification.AllowNotificationBeingPushed () [0x00007] in <f9fcfaf13de2474da4249e746e944d83>:0 at UniversalApp.UITests.Tests.BaseTest.TapAllowNotifications () [0x00014] in <f9fcfaf13de2474da4249e746e944d83>:0 at UniversalApp.UITests.Tests.BaseTest.Login () [0x00001] in <f9fcfaf13de2474da4249e746e944d83>:0 at UniversalApp.UITests.Tests.BaseTest.BeforeEachTest () [0x0000f] in <f9fcfaf13de2474da4249e746e944d83>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <48b95f3df5804531818f80e28ec60191>:0 --AggregateException at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <48b95f3df5804531818f80e28ec60191>:0 at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <48b95f3df5804531818f80e28ec60191>:0 at System.Threading.Tasks.Task.Wait () [0x00000] in <48b95f3df5804531818f80e28ec60191>:0 at Xamarin.UITest.iOS.iOSGestures.TapCoordinates (System.Single x, System.Single y) [0x00020] in <18ae7883e2424c558186d1d9edf9f14b>:0 at Xamarin.UITest.iOS.iOSApp+<>c__DisplayClass31_0.<TapCoordinates>b__0 () [0x0005e] in <18ae7883e2424c558186d1d9edf9f14b>:0 at Xamarin.UITest.Utils.ErrorReporting.With (System.Action func, System.Object[] args, System.String memberName) [0x00006] in <18ae7883e2424c558186d1d9edf9f14b>:0 --DeviceAgentException at Xamarin.UITest.XDB.Services.iOSDeviceAgentService+DeviceAgentResult.Validate (System.String action) [0x00023] in <18ae7883e2424c558186d1d9edf9f14b>:0 at Xamarin.UITest.XDB.Services.iOSDeviceAgentService+<RequestAsync>d__34`1[T].MoveNext () [0x00104] in <18ae7883e2424c558186d1d9edf9f14b>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <48b95f3df5804531818f80e28ec60191>:0 at Xamarin.UITest.XDB.Services.iOSDeviceAgentService+<GestureAsync>d__16.MoveNext () [0x000cd] in <18ae7883e2424c558186d1d9edf9f14b>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <48b95f3df5804531818f80e28ec60191>:0 at Xamarin.UITest.XDB.Services.iOSDeviceAgentService+<PointGestureAsync>d__35.MoveNext () [0x000a0] in <18ae7883e2424c558186d1d9edf9f14b>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <48b95f3df5804531818f80e28ec60191>:0 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <48b95f3df5804531818f80e28ec60191>:0 at Xamarin.UITest.XDB.Services.iOSDeviceAgentService+<TouchAsync>d__29.MoveNext () [0x0007d] in <18ae7883e2424c558186d1d9edf9f14b>:0
答案 0 :(得分:0)
我们在UITest中使用DeviceAgent,它应该自动接受通知。
我会检查您警报中的文本是否与DeviceAgent source code
相匹配文本可能与DeviceAgent中的任何示例都不匹配-在这种情况下,需要在上述文件中添加新条目,并发布新版本的DeviceAgent来处理此问题。
您也可以read more about this in the docs
我建议在appcenter.ms门户中寻求App Center支持,以寻求进一步的帮助。