I will start with an example: say you have a page table with 2 columns. You want to check, in your UI testing, that the values in the second column are the expected ones. By looking at the table you see that the first 2 and the last 5 values are the same. You have to iterate the table values to compare to the expected ones, but what is the simplest way to do this? You could use 2 for loops to check for those identical values, but you would just be repeating the code inside those for loops, as you would be writing the exact same checks. Even if it’s calling a separate method, it would still be a code repeat. Let me exemplify solving this situation using ‘chained’ for loops. Continue reading Joining multiple for loops in Python with ‘chain’ for repeating the same check for multiple groups of indexes
Tag Archives: validation
Using Maven checkstyle in your project to help adhere to coding standards
Coding standards are something both automating testers and developers should adhere to. Pretty obvious right? Maybe not that obvious might be some of the rules you should follow when writing the code for your tests. Checkstyle is here to help in standardizing your code, so that you can get an early feedback regarding code improvements (earlier than the code review step anyway). It allows you to define a set of basic coding rules that must be followed in your project, and it gives you the opportunity to make your builds fail if someone breaks those rules. This post addresses using checkstyle from a Maven project, by means of the dedicated Maven plugin that you need to declare in your project. Continue reading Using Maven checkstyle in your project to help adhere to coding standards
