如何通过动态方式在不同的环境和不同的浏览器中执行specflow功能文件 [英] How to execute specflow feature files in different environments and different browsers through dynamical

查看:104
本文介绍了如何通过动态方式在不同的环境和不同的浏览器中执行specflow功能文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用specflow + specrun进行自动化项目.我们有3个环境,分别是阶段,uat和生产.因此,我必须通过要运行的命令行动态传递环境,有时必须在单个浏览器中运行脚本有时要在多个浏览器中运行,以便如何通过命令行动态传递相同的内容,因此我们不得不一次在specrun中通过命令行在不同的浏览器中处理多个环境,我试图设置不同的目标,但我无法获得可同时处理浏览器和环境的解决方案

I am using specflow + specrun for automation project.we have 3 environments staging, uat and production .so I have to pass environments dynamically through command line which I want to run and some times I have to run the scripts in single browser and for some times to run in multiple browsers so how to pass same dynamically through command line, so we have to handle multiple environments at a time different browsers through command line in specrun, I have tried to set different targets but I am not able to get the solution to handle browsers and environments at a time

想以以下组合在应用程序中运行 -UAT Chrome -UAT Firefox -UAT所有浏览器 -STG镀铬 -STG Firefox -STG所有浏览器

Want to run in application in below combinations - UAT Chrome - UAT Firefox - UAT All browsers - STG Chrome - STG Firefox - STG All browsers

预先感谢

推荐答案

在解决方案中使用配置为字典创建一些内容,并为每个环境提供相应的链接,并为驱动程序提供相应的驱动程序功能.

Create something like a dictionary with the configuration in your solution with corresponding links for each environment and corresponding Driver capabilities for your drivers.

从执行脚本的位置(ci/console左右)传递一些参数.

Pass some parameters from the place you execute your script (ci/console or so).

取决于传递的变量-将测试框架配置为初始化由启动参数驱动程序指定的对象,并使用指向环境的指定URL.

Depending on passed variables - configure your test framework to initialize specified by start parameters driver and use specified URL to the environment.

这是默认的众所周知的方法.

This is the default well-known approach.

这篇关于如何通过动态方式在不同的环境和不同的浏览器中执行specflow功能文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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