Visual studio 2015 “错误”;您必须将测试代理设置为作为交互式进程运行;从TFS 2015构建过程运行编码UI测试时 当我尝试使用一个测试方法运行一个简单的编码UI测试项目时,它使用Team Foundation Server 2015(更新4)来验证Windows计算器应用程序的“添加”功能,在测试执行步骤中,我得到以下错误- Error calling Initialization method for test class CodedUITestProject1.CodedUITest1: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: To run tests that interact with the desktop, you must set up the test agent to run as an interactive process. For more information, see "How to: Set Up Your Test Agent to Run Tests That Interact with the Desktop" (http://go.microsoft.com/fwlink/?LinkId=255012) If you are running the tests as part of your team build, you must also set up the build agent to run as an interactive process. For more information, see "How to: Configure and Run Scheduled Tests After Building Your Application" (http://go.microsoft.com/fwlink/?LinkId=254735) Stack Trace: at Microsoft.VisualStudio.TestTools.UITesting.Playback.Initialize() at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestExtensionExecution.BeforeTestInitialize(Object sender, BeforeTestInitializeEventArgs e) at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecution.RaiseBeforeTestInitialize(BeforeTestInitializeEventArgs args) at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.RunInitializeMethod()

Visual studio 2015 “错误”;您必须将测试代理设置为作为交互式进程运行;从TFS 2015构建过程运行编码UI测试时 当我尝试使用一个测试方法运行一个简单的编码UI测试项目时,它使用Team Foundation Server 2015(更新4)来验证Windows计算器应用程序的“添加”功能,在测试执行步骤中,我得到以下错误- Error calling Initialization method for test class CodedUITestProject1.CodedUITest1: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: To run tests that interact with the desktop, you must set up the test agent to run as an interactive process. For more information, see "How to: Set Up Your Test Agent to Run Tests That Interact with the Desktop" (http://go.microsoft.com/fwlink/?LinkId=255012) If you are running the tests as part of your team build, you must also set up the build agent to run as an interactive process. For more information, see "How to: Configure and Run Scheduled Tests After Building Your Application" (http://go.microsoft.com/fwlink/?LinkId=254735) Stack Trace: at Microsoft.VisualStudio.TestTools.UITesting.Playback.Initialize() at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestExtensionExecution.BeforeTestInitialize(Object sender, BeforeTestInitializeEventArgs e) at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecution.RaiseBeforeTestInitialize(BeforeTestInitializeEventArgs args) at Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.RunInitializeMethod(),visual-studio-2015,tfs,tfsbuild,coded-ui-tests,tfs-2015,Visual Studio 2015,Tfs,Tfsbuild,Coded Ui Tests,Tfs 2015,设置/环境详细信息: 操作系统:Windows Server 2012标准(64位操作系统,基于x64的处理器) VS:Visual Studio Enterprise 2015及其更新3 TFS:Team Foundation Server 2015与更新4 生成定义(生成步骤)[非XAML定义]: 使用的运行设置文件: <?xml version="1.0" encoding="UTF-8"?> <TestSettings name="TestSettings1"

设置/环境详细信息: 操作系统:Windows Server 2012标准(64位操作系统,基于x64的处理器) VS:Visual Studio Enterprise 2015及其更新3 TFS:Team Foundation Server 2015与更新4

生成定义(生成步骤)[非XAML定义]:

使用的运行设置文件:

<?xml version="1.0" encoding="UTF-8"?>
<TestSettings name="TestSettings1" id="bd8c898e-4b22-407c-bc02-0861123a1dbd" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
    <Description>These are default test settings for a local test run.</Description>
    <Execution>
        <TestTypeSpecific>
            <UnitTestRunConfig testTypeId="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b">
                <AssemblyResolution>
                    <TestDirectory useLoadContext="true" />
                </AssemblyResolution>
            </UnitTestRunConfig>
            <WebTestRunConfiguration testTypeId="4e7599fa-5ecb-43e9-a887-cd63cf72d207">
                <Browser name="Internet Explorer 9.0" MaxConnections="6">
                    <Headers>
                        <Header name="User-Agent" value="Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)" />
                        <Header name="Accept" value="*/*" />
                        <Header name="Accept-Language" value="{{$IEAcceptLanguage}}" />
                        <Header name="Accept-Encoding" value="GZIP" />
                    </Headers>
                </Browser>
            </WebTestRunConfiguration>
        </TestTypeSpecific>
        <AgentRule name="LocalMachineDefaultRole">
        </AgentRule>
    </Execution>
    <Properties>
        <Property name="TestSettingsUIType" value="UnitTest" />
    </Properties>
</TestSettings>

这些是本地测试运行的默认测试设置。
我错过了上面的任何步骤吗?请帮助我解决构建失败问题

提前谢谢

问候,


阿扬

您使用了错误的任务。您需要使用而不是Visual Studio测试

典型情况包括:

  • 需要在测试机器上进行额外安装的测试,例如用于Selenium测试的不同浏览器
  • 编码用户界面测试
  • 需要特定操作系统配置的测试
  • 通过使用多台测试机器更快地执行大量单元测试
有关该任务的更多信息,请参阅本博客:


除了运行编码的UI测试外,您还必须将测试代理配置为与桌面交互,并以交互模式运行生成代理。

您是否有测试代理来运行测试或仅使用生成代理来运行测试?非常感谢您的帮助!通过上述链接和(由于另一个错误),我能够成功地运行编码的UI测试。@PatrickLu MSFT:有没有办法不使用
Interactive
代理,而是作为VSO的一部分来运行编码的UI测试?我遇到的情况是,代理池管理员不允许设置启用自动登录和禁用屏幕锁定的代理。