Some new tools to tackle the job in 2019

With 2019 practically upon us, I have some new tools to help with project management, task management, along with code and document organization. Since there is plenty of manual testing to be done, I've brought in Pagico to help manage projects and 2Do, to help with task management and test management. I've got MWeb for note taking, DevonThink Office to organize and manage all my notes, Coderunner to help write code pieces and SnippetsLab to store code pieces I'm working on. With Pagico, I can create lists, link documents, and group together the information I need for a given project. For example, I can enter due dates, store the links to Requirements and JIRA tickets, create reminders, track open tickets, and link to PDF files. In many respects it's my replacement for Freeter. I've tracked two projects so far with great success. 2Do is for task management, both for personal and project items. It's easy to create a list, set […]

Create a Dynamic Object at Runtime

I'm not quite at the point to need to make an object outside of the Object Repository, but I've seen reference to it multiple times and wanted to put together a simple example because who knows when it might come up. There have been several comments about keeping the size of the Object Repository small so it's better to programmatically create a one-off object rather than commit it to the project. Katalon Studio allows creating objects during runtime through the TestObject library. import com.kms.katalon.core.testobject.TestObject as TestObject import com.kms.katalon.core.testobject.ConditionType The object is created by giving it a name and associating a property to it. In the very simple example below, "xpath" is set with the location of a tab on the page. TestObject is created with the name "dynamicObject" The "dynamicObject" is given an xpath value that equals the contents of the xpath String Once the object has been created, it can then be clicked. The main work is done through […]

Get the xpath of an object in the Object Repository using findPropertyValue(‘xpath’)

In order to write a Custom Keyword to sum any column within a table, I need to know the number of rows in that table. I already have a Custom Keyword to count objects using the WebDriver, but is it possible to use the same method without having to define and pass the xpath separately? The answer is, yes, you can get the xpath of an object that exists in the Object Repository using: findTestObject and findPropertyValue(‘xpath’) This property can be read and then passed to a Custom Keyword such as countRowsPerPage. The String will look like: “//div[@id=’byMonth’]/div/table/tbody/tr” as though you defined it manually. To get things started, I have an object in the Object Repository called, Home/table-ytd-totals, which accepts Row and Column as variables to locate the cell in a table. This object will be used as part of the Test Case and is defined as: String katalonObject=”Home/table-ytd-totals” Using that reference, I want to create an Object variable so […]

A Custom Keyword to Verify a List of Product Categories

We recently implemented a change to the site that displays a different list of product categories based on the division a user is associated with. For example, if a User1 is associated with Division1, they see List1. User2 in Division 2 sees List2. User1 can’t see List 2 and vice versa. Since it’s important this list is correct for the user, it seemed a worthwhile to set it up as a test. While putting the code together, I noted a couple of things: – The table name may be different, but the list is always in a table – The list is always 10 items – The product names are always in the same order – The list appears in 5 different places Based on that, I decided to set up the code as a Custom Keyword so I could check the list regardless of where it showed up. Once the test was on the right page, a single call […]

Setting up a repeatable Search Method in Katalon Studio

Another one of my project goals was to extend functionality within tests by allowing a single task to be repeated multiple times for different criteria. Search is a good example. In the original incarnation, my search test would look for one item, confirm it was returned and that was the end. Getting a result back was good enough to say the functionality was working. But the actual search function could look for multiple criteria and I was only looking for one. Could that code be extended to be more dynamic without adding a slew of bloat? Yes it can. For my scenario, I want to search for a item by the state it’s located in, by the city it’s located in, or by it’s numerical code. For example, I can locate Warehouse 13 by searching for it by Arizona, or by AZ or by 13. All 3 criteria can be handled in one method. The code below gets the job […]