2024-02-07 –, Eficode
In our medium-sized project, we've used best practices and Robot Framework's power to minimize maintenance efforts. Easy test data management, data-driven testing even with various data items, fast and reliable test run preparation, human-readable keywords, and no need for dual script maintenance… – let us share our insights and tips!
Real-world projects serve as practical touchstones for theoretical concepts. Our current project, consisting of over 2500 lines of code and nearly 1000 lines of data, is still being developed. To ensure its sustainable growth without undue effort, we chose to adopt a meticulously structured approach.
Thankfully, Robot Framework, with its implementation of the keyword-driven testing concept, offers a wide variety of possibilities for structuring projects, be it the strict separation between human-readable test cases and their technically oriented implementations, importing data files in various formats, and the built-in differentiation of prerequisites of a test case and its implementation, to name the most useful ones.
With its mentioned features in mind, we have successfully implemented several concepts and best practices in our project. Key among them are:
- the strict separation of static test data from test scripts into YAML files (but still retaining randomness of values where needed), not only promoting data reusability across different tests;
- data-driven testing of similar scenarios notwithstanding different data items needed by them;
- utilizing queries to obtain dynamic test data from a database system, maximizing bug discovery possibilities;
- meeting the prerequisites of web tests through web services calls, vastly enhancing test preparation reliability and speed;
- carefully chosen keyword names and interfaces, each with a distinct purpose, leading to diminished demands on their documentation;
- a clear distinction between business keywords focused on human readability and technical keywords containing mainly implementation details; this, among others, enables people with limited technical backgrounds to assemble not only test cases but also some keywords.
This last point is of significant importance as it allows for the export of only the human-readable portions of a script into an issue-tracking system. This, in turn, enables manual execution of the script whenever needed, eliminating the need for dual maintenance of manual scripts alongside Robot Framework's automated ones.
We look forward to sharing our experiences, best practices, and tips for harnessing the full potential of not merely the highly structured approach inspired and enabled by Robot Framework's principles in a real-world project. Our goal is to inspire fellow professionals to explore the benefits of these techniques for enhancing their projects.
The audience or participants will gain practical and battle-tested techniques for handling test data and designing keywords (see the bullet points in the annotation of the contribution). The overall benefits of the methods to be shared include:
- Easier maintenance of test data, scripts and documentation;
- Increased likelihood of finding a bug;
- Improved speed and reliability of the test preparation phase;
- Enabling people with limited technical background to assemble both test cases and high-level keywords;
- Eliminating the need for duplicate maintenance: this of both manual and automated scripts.
The relevant passages of authentic code are to be shown to the audience, especially if the presentation is accepted in tutorial format.
Describe your intended audience:The ideal audience is people with some experience in test automation (but not necessarily in Robot Framework), such as TA architects and designers and intermediate TA engineers. However, even beginners could become aware of the ideas to be presented and will be able to use a few of them in their tests.
Prerequisites: You do not need to bring your laptop as this is NOT a hands-on tutorial.
Is this suitable for ..?:Intermediate RF user, Advanced RF user
Born with a sharp mind, a keen eye for detail and a cheeky mouth, I thrilled my teachers both in a positive (maths, physics) and negative (PE and so on) way. I worked as a scientist and a software developer, but I found the domain best suited to my unique blessings and curses nine years ago: software testing. These days, I annoy my fellow workers and bosses in the greatest Czech bank: Česká spořitelna. One of my professional interests is to explain to anybody why their code in Robot Framework (or Python or any other language) is dirty, fragile, slow or plainly terrible. The other one is creating internal standards for doing almost anything. I also enjoy mentoring juniors to transform them into the same beasts I am. My extracurricular interest is studying anything at universities, and I have just finished my 31st year of schooling.
I am a graduate of Applied Computer Science and Information Management and work as a consultant in Profinit for a subsidiary of Česká spořitelna. I started as a Python rookie, and today, I've been gaining experience for almost two years as a test automation developer in Robot Framework -- under the strict supervision of Václav, who has been on my back from the beginning and hasn't let me make the slightest mistake in my code. I focus on completing challenging tasks and overcoming obstacles, including those I create for myself. I'm not afraid of challenges, enjoy complicated things, and throw myself into them with a smile and my favorite cup of coffee. I step out of my comfort zone with various levels of enthusiasm to see how diverse the tasks I can tackle are. I like understanding things and figuring them out through personal development or trial and error.