DEV Community

Giovana da Silva
Giovana da Silva

Posted on

RoboCon 2024 - How to create a successful Robot Framework project

This summary captures the main points from Liviu Avram's presentation at RoboCon 2024 on How to create a successful Robot Framework project.

The motto of the presentation is "work smart not hard" and Liviu Avram says:

"For those of us who use Robot Framework and automate on a daily basis we know that automation should be fun, it should make life easy for us and harder for the developers. So you should have fun while building your projects but if you do it wrong, then you will make the life harder on yourself, it's like shooting yourself in a foot. So be careful not to do it wrong."

Defining Project Success

Defining project success involves creating a robust and sustainable framework that facilitates maintenance and adaptation over time.

  • Reliable: Project must run smoothly, no false positives, ru must be consistent and apart from third-party errors
  • *Well structured: * good organization of all project files, be able to find information as quickly as possible
  • Scalable and easy adapt: always develop with scalability in mind, create high level keywords and use proper arguments, the best you implement in the beggining makes it easier for you to modify afterwards
  • Easy to read: If you start reading your project you should be able to have a pretty good idea of what your project is about and what are the funcionalities that are being tested.

Things to consider starting a new project

  • Documentation: You should understand the product before starting to automate. Starting without documentation is a risky practice. Liviu shared his initial experience where the lack of documentation and hardcoding values complicated project maintenance. He advises starting with clear documentation and using variables to avoid these issues in the future.

  • Testing the product before automating: When manual tests are needed before automating, testing throught as many scenarios as possible will enable you to map test cases that need to be implemented, needed resources and needed libraries.

  • Future of the product: Knowing what the product will become helps to set the right strategy about scalability and risks that may appear on the long run.

  • Don't take certain behaviors for granted: Poor documentation leads to unrealiable features, often these features are not tested or tested the wrong way. So if some information about the feature is missing make sure to reach to a product owner or somebody who's in charge of the product.

Good Practices in Automation

  • Each test should be independent: It's easier and more efficient to verify funcionalities and one test does not rely on another test, making possible to run tests in any randon order.

  • Organize files and folders: Structuring projects in an organized manner is crucial.

  • Group everything by criteria: It's easier to to search for information if you have a good criteria to group everything.

Liviu emphasized using resource files specific to each application functionality, grouping keywords and variables clearly and descriptively. This not only makes it easier to locate specific elements but also makes the code more readable and maintainable.

  • Create keywords about everything: create keywords for every step or funcionality.

  • Create good keywords name: create good keyword names so you can easily track them.

  • Use variables: avoid hardcoding values or locators inside testcases, use comprehensive variable names.

  • Combine keywords and variables: create keywords that can be used in multiple scenarios

  • Avoid sleeps: should be used only as last resource, it's a bad practiced and also increases the execution time dramatically.

Avoiding bad practices is essential for project longevity and efficiency. Avoiding sleeps, hardcoded arguments and creating keywords that accept arguments for reuse and creating generic names that can cause confusion as the project grows. He also suggested creating high-level keywords from low-level library keywords to ease transitions between different libraries.

Tips and Tricks in automation

Among the advanced tips and tricks, Liviu recommended using analytical tools to monitor keyword usage and identify the right level of abstraction. He also suggested creating flexible keywords that can be reused in multiple contexts, increasing code efficiency.

Enhancing Readability

Enhancing code readability is crucial for maintenance and team collaboration. Liviu emphasized the importance of clear structure, descriptive names, and creating a coherent story in the code that can be easily understood by both technical and non-technical team members. He demonstrated how to apply all the discussed principles to transform complex code into a clear and organized narrative.

Integrating these practices into your workflow can ensure robust, scalable, and sustainable projects, providing a solid foundation for future adaptations and improvements. For more details, check out the full presentation on YouTube. Happy automating!

Feel free to share your thoughts or ask any questions in the comments.

Top comments (0)