问题
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