【问题标题】:Coded UI Test Method Runs only when VS is launched as administrator编码的 UI 测试方法仅在 VS 以管理员身份启动时运行
【发布时间】:2017-12-30 22:08:38
【问题描述】:

我正在通过 ProcessStartInfo 启动需要管理员权限的 Windows 应用程序。 ProcessStartInfo app= new ProcessStartInfo(Path.exe); app.UseShellExecute = true; app.Verb = "runas"; MainWindow= ApplicationUnderTest.Launch(app);

启动运行正常,但在我以管理员身份运行 VS 之前无法识别控件。如何在不以管理员身份启动 VS 的情况下成功运行测试方法?

【问题讨论】:

    标签: c# automation coded-ui-tests


    【解决方案1】:

    您必须从您的 Windows 设置中签署 Visual Studio 安全。

    1. 右键单击“Visual Studio”并选择“打开文件位置”
    2. 右键单击“Visual Studio”并选择“属性”
    3. 点击“高级”,勾选“以管理员身份运行”

    【讨论】:

      猜你喜欢
      • 2015-07-31
      • 2011-11-15
      • 2011-07-04
      • 2012-03-21
      • 1970-01-01
      • 1970-01-01
      • 2021-01-01
      • 2014-09-11
      • 1970-01-01
      相关资源
      最近更新 更多