TestContext类未返回TFS 2018中的所有值 [英] TestContext class is not returning all the values from TFS 2018
问题描述
您好
我正在从TFS 2017升级到TFS 2018以执行我的编码ui脚本。之前我使用MTM与TFS 2017与Visual Studio 2015 Enterprise连接的脚本执行。
I am upgrading from TFS 2017 to TFS 2018 to execute my coded ui scripts. Earlier I am using MTM for script execution connected with TFS 2017 with Visual Studio 2015 Enterprise.
我使用以下代码获取配置属性和其他属性:
I am fetching configuration properties and other properties using below code:
TestContext tctx
TestContext tctx
using(TfsTeamProjectCollection collection = new TfsTeamProjectCollection(TfsTeamProjectCollection.GetFullyQualifiedUriForName(AppConfig.GetValue(" TFS_URL")))))
                  {
&NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; ITestManagementService tcmService = collection.GetService< ITestManagementService>();
&NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; &NBSP; ITestManagementTeamProject项目= tcmService.GetTeamProject(" ProjectName");
using (TfsTeamProjectCollection collection = new TfsTeamProjectCollection(TfsTeamProjectCollection.GetFullyQualifiedUriForName(AppConfig.GetValue("TFS_URL"))))
{
ITestManagementService tcmService = collection.GetService<ITestManagementService>();
ITestManagementTeamProject project = tcmService.GetTeamProject("ProjectName");
ITestPlan tplan = project.TestPlans.Query(" Select * from TestPlan")。Where(tp => tp.Id.ToString()== tctx.Properties [" __ Tfs_TestPlanId __"]。ToString())。FirstOrDefault( );
ITestPlan tplan = project.TestPlans.Query("Select * from TestPlan").Where(tp => tp.Id.ToString() == tctx.Properties["__Tfs_TestPlanId__"].ToString()).FirstOrDefault();
ITestPoint col = tplan.QueryTestPoints(string.Format(" SELECT * FROM TestPoint"))。Where(tp => tp.Id.ToString()= = tctx.Properties [" __ Tfs_TestPointId __"]。ToString())。FirstOrDefault();
ITestPoint col = tplan.QueryTestPoints(string.Format("SELECT * FROM TestPoint")).Where(tp => tp.Id.ToString() == tctx.Properties["__Tfs_TestPointId__"].ToString()).FirstOrDefault();
当从MTM运行编码的ui脚本时,这组代码工作正常,但是当我使用TFS 2018时,我在线路上收到错误 &NBSP; ITestManagementTeamProject项目= tcmService.GetTeamProject(" ProjectName");
This set of code works fine when running coded ui scripts from MTM but when i use TFS 2018 then i am getting error on the line ITestManagementTeamProject project = tcmService.GetTeamProject("ProjectName");
错误: {"无法加载DLL'Microsoft.WITDataStore32.dll':找不到指定的模块。 (来自HRESULT的异常:0x8007007E)"}
Error: {"Unable to load DLL 'Microsoft.WITDataStore32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}
此外,不存在类似于 tctx.Properties [" __ Tfs_TestPlanId __"]的TestContext属性。
Also the TestContext properties like tctx.Properties["__Tfs_TestPlanId__"] is not present.
请建议做什么。
推荐答案
测试代理和控制器的版本是什么(例如2017)?
What's the version of test agent and controller (e.g. 2017)?
您是否使用此软件包:
Microsoft Team Foundation Server扩展客户端
这篇关于TestContext类未返回TFS 2018中的所有值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!