【问题标题】:UI selenium Test in Azure devops ReleaseAzure devops 版本中的 UI 硒测试
【发布时间】:2019-02-25 13:19:19
【问题描述】:

我正在尝试使用 IIS 部署创建发布管道,之后,有 UI Selenium 测试项目。

除文件上传器外,一切正常。如何处理文件上传器? VSTS 代理不允许从项目文件夹中获取文件。 我尝试将文件放入 Sharepoint 并从那里获取流并尝试保存在项目目录中,但仍然不允许保存文件。

var directory = Assembly.GetAssembly(typeof(HelperClass)).Location;
Console.WriteLine(directory); var newDir = 
directory.Replace("\\bin\\Release\\MarloTest.dll", "\\bin\\Release"); 
Console.WriteLine(newDir); 

if (Directory.Exists(newDir)) return newDir;

(var file= new FileStream(newPath, FileMode.Create)) 
{ 
   var streamFile = stream; streamFile.CopyTo(file); 
}

提前致谢

【问题讨论】:

  • 你能分享你用来获取文件的代码吗?您确定当前工作目录实际上是您期望的文件夹吗?您如何解决项目文件夹?您使用什么测试框架来驱动 Selenium 测试?
  • @jessehouwing 通过这条路径,我得到了 azure devops 代理上的项目执行 dll 的目录。 var directory = Assembly.GetAssembly(typeof(HelperClass)).Location; Console.WriteLine(directory); var newDir = directory.Replace("\\bin\\Release\\MarloTest.dll", "\\bin\\Release"); Console.WriteLine(newDir); if (Directory.Exists(newDir)) return newDir;
  • @jessehouwing 为了保存文件,我正在使用此代码 using (var file= new FileStream(newPath, FileMode.Create)) { var streamFile = stream; streamFile.CopyTo(file); } 在本地,这工作正常,但不适用于运行测试程序集的 devops azure 代理 HostedVS2017。
  • 您可以编辑上面的问题,而不是将代码放在 cmets 中吗?它很难阅读,其他人解决这个问题需要拼凑拼图。

标签: selenium-webdriver azure-devops azure-pipelines


【解决方案1】:

您使用哪些代理从发布管道中触发 UI 测试?如果它的托管代理,我怀疑它是否有效。尝试安装您自己的代理并触发发布。运行 Selenium UI 测试,可以参考here

【讨论】:

  • 为什么怀疑它是否有效?托管代理以交互方式运行并配置为支持运行 UI 测试
猜你喜欢
  • 1970-01-01
  • 2021-06-09
  • 2020-05-04
  • 2021-04-20
  • 2023-01-03
  • 2020-12-24
  • 1970-01-01
  • 2021-03-07
  • 1970-01-01
相关资源
最近更新 更多