2

我正在 Visual Studio 2015、C#、Xamarin 6.1.3.、iOS 10.2、iPhone 6s Plus、Xcode 8.2 中编写移动自动测试。并尝试从 Mac Agent(OS X El Capitan 10.11.6)上的 Windows 10 远程启动自动测试。我已经在 VS 中设置了远程连接,因此 xamarin Mac Agent 已连接: mac代理已连接 这就是我尝试在我的代码中启动应用程序的方式:

IApp iApp = ConfigureApp
                .iOS
                .DeviceIp(mac_ip)
                .DeviceIdentifier(iphone_device_identifier)
                .AppBundle(/path_to_ipa/application.ipa)
                .Debug()
                .StartApp();

StartApp() 方法的测试失败,并显示消息“Windows 不支持 iOS 测试”。

at Xamarin.UITest.iOS.iOSApp..ctor(IiOSAppConfiguration appConfiguration)
at Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp(AppDataMode appDataMode)
at Xamarin.Application.Initialize() in D:\_framework mobile\framework\Framework\Xamarin\Application.cs:line 30
at Xamarin.Application..ctor() in D:\_framework mobile\framework\Framework\Xamarin\Application.cs:line 22
at Xamarin.Application.GetInstance() in D:\_framework mobile\framework\Framework\Xamarin\Application.cs:line 54
at Specflow.Hooks.BaseSteps.StartApplication() in D:\_framework mobile\framework\Framework\Specflow.Hooks\BaseSteps.cs:line 19
at lambda_method(Closure , IContextManager )
at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireEvents(HookType bindingEvent)
at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnScenarioStart(ScenarioInfo scenarioInfo)
at TechTalk.SpecFlow.TestRunner.OnScenarioStart(ScenarioInfo scenarioInfo)
at Specflow.Features.DemoFeatureFeature.ScenarioSetup(ScenarioInfo scenarioInfo)
at Specflow.Features.DemoFeatureFeature.AddTwoNumbers() in D:\_framework mobile\framework\Framework\Specflow.Features\DemoFeature.feature:line 7
Result Message: 
Test method Specflow.Features.DemoFeatureFeature.AddTwoNumbers threw exception: 
System.Exception: iOS tests are not supported on Windows.

早些时候,我在同一设备和 mac 上使用 appium 启动了同一应用程序 - 一切正常。

我没有指定 .DevicePort() 因为我不知道如何获取端口,但我想当只连接 1 个设备时它不是必需的。

我也尝试在模拟器中启动,但我遇到了同样的错误。

4

1 回答 1

2

不支持使用 Mac 代理从 Windows 运行 iOS Xamarin.UITests。来源:https ://forums.xamarin.com/discussion/71138/how-to-run-test-using-vs-on-ios-simulator-on-mac#latest

于 2016-12-28T21:22:40.797 回答