【问题标题】:set up c# Selenium webdriver to Jenkins将 c# Selenium webdriver 设置为 Jenkins
【发布时间】:2016-05-29 10:20:47
【问题描述】:

我正在尝试将我的 Selenium webdriver for .Net 测试设置为 Jenkins,第一次设置为 Jenkins 之前从未尝试过,但遇到了一些令人头疼的问题。

我在Jenkins 中安装了VSTest Runner plugin,在Configuration 中我在VSTest 安装程序中将Path 添加到VSTest C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

并添加了运行测试:

但出现以下错误:

Error: The test source file "C:\Program" provided was not found.
Error: The test source file "Files" provided was not found.
Error: The test source file "(x86)\Jenkins\jobs\Jenkins" provided was not found.
Error: The test source file "Test" provided was not found.
Error: The test source file "App\workspace\RegressionTestLibrary\bin\Debug\RegressionTest.dll" provided was not found.

看起来它将空格读取为换行符,我什至不确定是否正确,任何人都可以启发我吗? :)

【问题讨论】:

    标签: .net jenkins selenium-webdriver vstest


    【解决方案1】:

    您可以尝试使用 Windows 批处理命令 而不是插件。我将假设您使用的是 Jenkins 的单个实例,而不是主从结构(具有多个节点的 Jenkins):

    1. 转到 Jenkins 仪表板 > 管理 Jenkins > 配置系统 > 全局属性 > 选中 环境变量s 框并添加 Path 带有 VSTest 运行器位置的变量。 (以附图为例) First Step

    2. 转到您的 Jenkins 作业 > 添加 构建步骤 > 执行 Windows Batch 命令 并输入:vstest.console.exe "{{ your_test.dll_location }}"。该路径相对于工作区 Jenkins 文件夹。 Second Step

    如果您使用的是节点: 转到 Jenkins Dashboard > Your Node > Configure > Node Properties 选中 Environment Variable 框并添加 Path 变量与您的 VSTest 运行器的位置。重复第 2 步,但不要忘记选中作业配置中的限制此项目可以运行的位置框并选择标签 用于您的节点。

    结果: Result

    希望对您有所帮助!

    【讨论】:

      【解决方案2】:

      我遇到了这个确切的问题,我通过替换来解决它 C:\Program Files(x86)\Jenkins\jobs\Jenkins Test App\workspace{WORKSPACE} 所以对你来说它应该看起来像 {WORKSPACE}\RegressionTestLibrary\bin\Debug\RegressionTest.dll,但是我现在遇到的问题是我的构建将通过,但现在控制台告诉我

      开始测试发现,请稍候...

      完成:成功

      所以我的测试从未真正运行过,这可能是一个单独的问题,据我所知,您可能不会遇到它。

      【讨论】:

        猜你喜欢
        • 2013-03-08
        • 2013-07-26
        • 2015-08-27
        • 2012-10-01
        • 2018-01-06
        • 1970-01-01
        • 2013-10-16
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多