1

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]

2
  • In order to help you with your technical issue can you share a minimal reproducible example with us by an edit of your question? That way we can specify our answers to your particular situation. Commented Jan 25, 2018 at 16:11
  • In robot Framework we can write test cases under Test Suite. But i want to write test case in Excel file having different sheets(Grouping test cases in different sheets as per module) and then use those Excel file in Robot Framework as Test Cases.Can we write test cases in Excel file ?So that it will be easy for any user to write test cases and track it just by looking into excel sheets. How i can ready data from these excel file as test cases in robot framwork and exeucte it ? Commented Jan 29, 2018 at 10:27

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

5 Comments

In robot Framework we can write test cases under Test Suite. But i want to write test case in Excel file having different sheets(Grouping test cases in different sheets as per module) and then use those Excel file in Robot Framework as Test Cases.Can we write test cases in Excel file ?So that it will be easy for any user to write test cases and track it just by looking into excel sheets. How i can ready data from these excel file as test cases in robot framwork and exeucte it ?
You cannot do that - you cannot have the source test cases data in Excel file and have Robot Framework use them, to create the actual data-driven test cases. That is what my answer is saying.
oh ok thanks... so writing test cases in Robot itself in .txt/.robot/.TSV is the only option..
Right; until an alternative is created in the framework itself, or in a library. I myself tried the latter some months ago, but abandoned it on the 2nd hour due to the internal complexity of RF and the level of monkeypatching I was getting to (with my approach, at least).
Ok. Thanks a lot Todor. Thanks for your help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.