RobotFramework - Run Tests on different environments

怎甘沉沦 提交于 2020-01-06 05:27:27

问题


I need to run specific tests for specific environments QA, Dev, Test etc., I have put a Tag on different tests i want to run on different, I am using AppiumLibrary as I am working on a mobile device, I was thinking to use a text file with all variables i need to execute for specific enviroments something like this.

    --variable Env:http://example.test.com:1111
    --variable remoteUrl:http://127.0.0.1:123/web/hub
    --variable platformVersion:8.0
    --variable platformName:Android
    --variable deviceName:Samsung
    --variable automationName:appium
    --variable appPackage:SamplePackage
    --variable appActivity:Activity
    --variable noReset:True

I need to pass this configuration in order for my app to hit the environment, Is there are way to use the --variables inside robot framework or is there a better approach to run tests on specific environments?


回答1:


If I understand your question, all you need to do is pass that file as the value of the --argumentfile option. My team uses files that that. We have files named smoke.args, prod.args, etc. We use them like this:

robot --argumentfile dev.args tests

With that, any variables in the file are accessible in your tests just like any other variables.



来源:https://stackoverflow.com/questions/52298417/robotframework-run-tests-on-different-environments

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