Can we write test cases in CSV OR Excel file in Robot Framework and execute just by reading CSV file

心不动则不痛 提交于 2020-01-25 07:50:10

问题


I am working on Robot Framework for mobile App Automation. I have written test cases and keywords in Test Suit in Robot Framework and i can execute it. But i am trying to have test cases written in CSV OR Excel file which will be the input to Robot Framework (like we do in Test Complete). How we can write test cases in CSV/Excel file [looking for format] which is readable by Robot-framework and how we execute these test cases in Robot by reading the CSV file.Please help [Note : For now i can just read the CSV file and log the data.But its not executing cases on mobile]


回答1:


Data-driven cases like Robot Framework' Template ones, where the actual test data is fed from an external csv or Excel file?

Regretfully that is not possible at present, due to the way RF parses the source test files and constructs its internal objects.
Rougly put, at the time of parsing it stores the current state ("the text") of the [Template] case and substitutes keywords with methods etc., constructing the set of the actual cases to be ran, at this very moment. If the test data is to be loaded later on - "injected in the run", it will change the number of cases which is far from trivial at this stage.

I do see value in a library/extension for this - for example to "outsource" the cases to PMs/developers ;), but don't think there is one right now.



来源:https://stackoverflow.com/questions/48443520/can-we-write-test-cases-in-csv-or-excel-file-in-robot-framework-and-execute-just

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