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