我尝试在 Visual Studio 2015 Enterprise 中记录 Windows 10 上运行的 IE 中最简单的编码 UI 操作。问题是最近我开始得到Value cannot be null. Parameter name: key
每次点击都会出错Add and Generate
button.
另外,每次我将链接悬停在 IE 网页上时,都会出现“访问被拒绝”错误。我相信这些问题可能是相关的。
One more issue is that I can not generate any assertions since am unable to select any web control on web page. After I placed Coded UI Test Builder's crosshair in the middle of text input the whole document was highlighted.
为了解决这个问题,我被建议检查项目参考资料。因此,我包含了我能找到的任何可能与编码 UI 相关的参考。这是该项目中包含的参考文献的完整列表:
除了我已经尝试过:
1.重启VS
2. 重新启动电脑
3.以管理员身份运行VS和IE(与访问被拒绝问题相关)
4. 向项目添加新的 UIMap 文件。我尝试在那里记录动作。
5. 正如评论之一所建议的here https://social.msdn.microsoft.com/Forums/vstudio/en-US/efa0bb2e-8d1a-4213-95a7-fb521cfad97e/get-access-is-denied-while-recording-on-code-ui-test-builder?forum=vstest我检查了浏览器缩放级别并将其设置为 100%。
6. 使用新的 CodedUI 测试项目开始新的解决方案。
7. 通过执行以下命令,从 Visual Studio 开发人员命令提示符中将编码的 UI 测试生成器作为独立应用程序启动codedUITestBuilder.exe /standalone
在命令行中。
8. 尝试记录针对 Windows 资源管理器的编码 UI 测试。结果我得到了很多// Access is denied.
评论行。
9. 在安全模式下启动VS。测试构建器不会失败,但结果我得到// The last action was not recorded because access to the application was denied.
并且没有记录实际步骤。
10.运行Visual Studio以管理员身份进入安全模式所以没有外部插件影响 VS。
11. 我重新安装了 Visual Studio。这没有帮助。
12. 为 ui 组件启用跟踪 https://blogs.msdn.microsoft.com/gautamg/2009/11/29/how-to-enable-tracing-for-ui-test-components/但在录制过程中不会生成实际输出。 Visual Studio下的输出窗口Testing选项卡仍为空。
13.检查了CodedUITestBuilder.exe.config
。以下配置已被注释,因此我取消注释:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
14. 正如评论中所建议的here https://social.msdn.microsoft.com/Forums/en-US/0d403356-623a-4f80-91ae-0c3ce0a86739/coded-ui-access-is-denied-and-uispy-cant-identify-the-buttons-control?forum=vsautotest我添加了%ProgramFiles%\Internet Explorer\iexplore.exe
作为的价值观之一ExcludeProcess
进而IncludeProcess
中的部分CodedUITestBuilder.exe.config
。问题是现在我实际上别看Access is Denied
错误,但我仍然无法记录任何步骤或在 html 控件上移动十字准线.
网上的大多数解决方案都是重新安装 Visual Studio,如果没有帮助,请重新安装 Windows。这对我来说是不可接受的解决方案。如何在不重新安装 Visual Studio 和/或 Windows 的情况下解决该问题?