How to execute specflow feature files in different environments and different browsers through dynamical

和自甴很熟 提交于 2020-04-30 06:27:06

问题


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

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

Thanks in advance


回答1:


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

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

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.



来源:https://stackoverflow.com/questions/60044416/how-to-execute-specflow-feature-files-in-different-environments-and-different-br

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!