【发布时间】:2019-10-15 15:58:44
【问题描述】:
我在启用开发者模式的情况下运行 Win10,并启动了 WinAppDriver。在 VS 2019 中,我运行了计算器示例,但每次测试都失败并出现异常。然后我尝试设置一堆断点,但是当我运行测试时,它永远不会在我的断点处中断。
这是异常的堆栈跟踪:
Test Name: Addition
Test FullName: Test Detail Summary
Test Source: C:\Code\WinAppDriver-1.1.1\Samples\C#\CalculatorTest\ScenarioStandard.cs : line 31
Test Outcome: Failed
Test Duration: 0:00:00
Test Name: Addition
Test Outcome: Failed
Result StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Appium.AppiumDriver`1.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebElement.Click()
at CalculatorTest.ScenarioStandard.Clear() in C:\Code\WinAppDriver-1.1.1\Samples\C#\CalculatorTest\ScenarioStandard.cs:line 131
Result Message: Initialization method CalculatorTest.ScenarioStandard.Clear threw exception. System.InvalidOperationException: An unknown error occurred in the remote end while processing the command..
任何想法为什么测试不起作用,为什么它没有在我的断点处中断?
【问题讨论】:
-
您的问题与this有关吗?
-
关于断点,我遇到了某种错误,我总是必须清理和重建我的解决方案,然后测试脚本才会接收到任何代码更改。就像 VS 在编译旧代码一样。如果该代码上有任何断点,则不会触发它。
-
调试问题是我的错误。我是测试资源管理器的新手,我认为当您选择运行测试时断点会命中,但我现在看到您必须右键单击并选择调试测试。
标签: c# winappdriver