如何在Runsettings文件参数< SettingsFile>上为测试设置制定文件路径. [英] How do i formulate file path for testsettings on the Runsettings file parameter <SettingsFile>

查看:174
本文介绍了如何在Runsettings文件参数< SettingsFile>上为测试设置制定文件路径.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为runsettings参数形成相对文件路径或文件路径的正确方法是什么

Whats the proper way to form relative file path/ or file path for the runsettings parameter

<SettingsFile>xxxxxAutomation.testsettings</SettingsFile> 

这在我的本地环境中有效,但是当我将其推入构建发布代理时,由于 它在我的发布文件夹的另一个目录中寻找文件 而是在文件夹目录中寻找该文件.

In my local environment this works but when i push it to build release agents it fails since its looking for the file in a different directory which is my release folder but instead its looking for this file in what appears to be in a folder directory.

这是它查看E:\ Agent_work \ r10 \ a \ xxxxxxxxx.testsettings的目录,

This is the directory its looking at E:\Agent_work\r10\a\xxxxxxxxx.testsettings,

这是我目前设置的方式

<SettingsFile>xxxxxAutomation.testsettings</SettingsFile> 

这是错误消息 错误:MSTestAdapter设置中指定的测试设置文件E:\ Agent_work \ r10 \ a \ xxxxxxxxxx.testsettings不可用.对该文件的访问被拒绝或该文件不存在.确保测试设置文件可用,然后重试.

here is the error message Error: The test settings file E:\Agent_work\r10\a\xxxxxxxxxx.testsettings, specified in the MSTestAdapter settings, is not available. Either access to the file is denied or the file does not exist. Ensure that the test settings file is available and try again.

而不是 E:\ Agent_work \ r10 \ a_XXXXX CI Build \ drop \ XXXXX_Automation_Test \ bin \ Release \ xxxxxxxxx.testsettings

instead of E:\Agent_work\r10\a_XXXXX CI Build\drop\XXXXX_Automation_Test\bin\Release\xxxxxxxxx.testsettings

没有文档说明如何在msdn上制定文件路径并且没有看到 任何在线内容.

There is no documentation that states how to formulate the file path on msdn and didn't see anything online.

推荐答案

我建议您可以添加

I suggest you can add a Copy Files task to copy the missing file from .../bin/release folder(Use the browse option) to default working directory:

我建议您通过修改管道而不是设置文件来解决此问题,以便您也可以在本地使用未更改的运行设置文件来很好地工作.

I suggest you resolve this issue via modifying your pipeline instead of settings file, so that you can also work well locally with the unchanged runsettings file.

此外:Clean Target Folder输入应被禁用(未选中),因为我们的目标文件夹是默认的工作文件夹.删除该文件夹中的所有文件会导致意外的问题.

In addition: Clean Target Folder input should be disabled(unchecked) cause our target folder is the default working folder. Deleting all files in that folder would cause unexpected issues.

这篇关于如何在Runsettings文件参数&lt; SettingsFile&gt;上为测试设置制定文件路径.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆