My Key Tools for Automation

With this new project now fully under way, I have noted 3 pivotal tools that make code development much faster than before. TypeIt4Me (Text Expander) – I had this last time, but it now has a couple dozen code fragments at the ready. I have entries for getText, setText, click, waitForElementVisible, for, while, case, replaceAll, and a bunch more. I type the name of the command I want, and it gets converted to the full syntax with placeholders where the names of variables and objects should go. If I type something more than twice, it goes into the Text Expander and probably saves an hour per day of typing and looking up the syntax. CopyLess (Clipboard Manager) – This is a huge help for duplicating object names and lines of code. I can copy multiple things at once, then paste them back in whenever I need them. I don't lose the last thing I copied. I also don't have to […]

What the deuce is this nonsense?

This isn't my code, but it was written by a consulting company we brought in quite some time ago. They worked on some automation code, that was supervised by someone else. Neither that person, nor the consulting company work with us anymore. It appears they did some work on the site I am currently building out. I found dozens of instances of code like the following, and I have to shake my head in wonder as to what they were thinking. cropAcreValue = cropAcreValue.toString().toInteger() if (QA_submittedBy.toString().trim().equalsIgnoreCase('')) { I can't even begin to understand how they thought this was a good idea. I know my code isn't very good at times, but at least I'm not writing stuff like that and committing it to Master.

What’s in a Method?

Here is a style question. For a test I am working on, I have a simple table that lists a User Role. That role is a clickable link. I have two things I want to check on this page. First, I want to check that the User Role is a known text value, such as Admin or Sales Rep. Second, I want to check that the link for that role is Clickable. This is a simple validation test of two pieces of information. But, the question is, should both of these items be checked within one method, or should it be done as two? This is a simple example, where the isClickable is determined right after the searchResult. It's something I am literally working on right now. Is it more advantageous and proper to have the method check a single point of failure, or should it work on related items at the same time without making another call? Example 1: […]

One month of quarantine/self isolation

It is now official. I have been working from home for one month. Friday the 13th was my first day away from the office, a rather auspicious day to kick things off. The first week was a little strange, but now, after these four weeks of getting set up and settled in, it feels like the norm. I have my work machine set up at home, with the same monitor config I had before. That's because this is the machine I had at work. I've had the ability to work from home for several years. And on occasion, due to weather or appointment, I have benefited from it. But, that has been for one day and at most I might miss a meeting. If there was a lot of activity, I would simply go back into the office. Now that I've been at home, and working with teammates over Slack, Email, and Zoom, as well as working on my own […]

Building an automation project, some error handling

As I mentioned, I write automation code in phases, the same process that is done for editing photos in Photoshop or writing a novel. Photos are edited in layers. Each layer adds a small change to the overall image. Novels start with an outline. The outline is then turned into chapters. The chapters are broken down into scenes. A scene may only be a few paragraphs. Those are then connected to the next scene, which might only be a couple of paragraphs. Automation follows a similar process. I pick a set of pages I want to work with. They might be relevant for a production smoke test. Or they might be the more important or more frequently used sections. Either way, my goal isn't to write automation for the entire site. The goal is to pick important or high traffic areas and focus on those first. Once inside Katalon, the goal of the first phase is to map out the […]