Using TypeIt4Me with Katalon Studio

In an previous article, I made comment of TypeIt4Me as a helpful tool to work alongside Katalon Studio. After several months, I have a full library of code snippets tucked away in TypeIt4Me, that allow me to put tests together much faster. In essence, I have automated parts of my automation code.

TypeIt4Me is a text expander that allows me to type a single keyword and have it converted to a block of code. In most demos you see, the example is to type in something like “ttyl” which converts to Talk to you later. Or an “addr” abbreviation gets converted to:

1313 Mockingbird Ln
Anywhere ST, 90210.

These are fine examples, but code snippets are just as valid and save a huge amount of time.

For example, I have the keyword replace@ set up as:

tempText=tempText.replaceAll("[\$,]", "")

I can also type in for@ and get:

for (loop = 1; loop <=10; loop++) {
  println(loop)
}

The amount of expanded text can be just about anything. I also have one for the “lorem ipsum” text. I type in lorem@ and I get:

Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Sed posuere consectetur est at lobortis. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Sed posuere consectetur est at lobortis. Etc, etc, etc, for another couple paragraphs.

It could also be more meaningful code like reading the contents of a table using the web driver code, as in this example:

readtable@

WebDriver driver = DriverFactory.getWebDriver()
WebElement Webtable=driver.findElement(By.id("sales_dash_table")); // Replace TableID with Actual Table ID or Xpath
//Get the number of rows in the table and turn it into a List
List<WebElement> TotalRowCount=Webtable.findElements(By.xpath("//*[@id='sales_dash_table']/tbody/tr"));
//Display the number of rows in the table for the given sales rep
log.logWarning("No. of Rows in the WebTable: "+TotalRowCount.size());
//Loop through the table and output the information to Log File
//Read columns 1-4, assign each to a variable, then output the result to the Log File
for (loop =1;loop<=TotalRowCount.size();loop++)
{
companyName= driver.findElement(By.xpath("//*[@id='sales_dash_table']/tbody/tr[" + (loop)+ "]/td[1]")).getText();
log.logWarning('Company Name:=' + companyName)
sales= driver.findElement(By.xpath("//*[@id='sales_dash_table']/tbody/tr[" + (loop)+ "]/td[2]")).getText();
log.logWarning('Sales Figure Amount:=' + sales)
gp= driver.findElement(By.xpath("//*[@id='sales_dash_table']/tbody/tr[" + (loop)+ "]/td[3]")).getText();
log.logWarning('Gross Profit:=' + gp)
margin= driver.findElement(By.xpath("//*[@id='sales_dash_table']/tbody/tr[" + (loop)+ "]/td[4]")).getText();
log.logWarning('Margin % :=' + margin)
}

This is exceptionally faster than copy/paste and even if these snippets don’t turn out to be ones I use every day, I have a library of examples all in one place. For many, the only thing I have to change is the variables.

If you notice, each keyword has the @ symbol at the end. This is something I chose to make sure the text isn’t expanded accidentally. It purposefully denotes in my mind that I am inserting text and is a simple keystroke to add.

The other benefit of an program like TypeIt4Me, is that it’s available system wide. Atom and other editors can store snippets just as easily, but TypeIt4Me is available in all apps. I can use it within Katalon, within Atom, within Textmate, within Jira, within Github and everywhere else I work.

Text expanders aren’t just for writing emails or expanding the odd abbreviation here and there. They can be extremely power and beneficial to write commonly used code fragments and as a repository of useful code. TypeIt4Me says I have saved over a dozen hours of typing using this method.

Other articles of interest:

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Comments
  • How To Disable the Quicken Registration Prompt (16)
    • Dave: Works for Quicken 2007 too. Thanks, Gina!
    • Charlie Fellenbaum: Yay, thanks, and that worked for Quicken 2006 as well.
    • Ken: This didn’t work for me. I have 2006. I installed on a new laptop. I must have registered before, don’t remember. I tried to register this time, but got an error message. I’d rather not registered, though. I use...
    • Neil Murphy: I discovered that early on. I’m using 2001.
    • Jeremy: Thank you so so so much. I am still using Quicken 2010 because Intuit didn’t want to properly support users abroad anymore (never mind that they only link to US banks for transaction downloads; they didn’t want my...
  • Quasi Performance/Load Testing with Katalon Studio (1)
    • Anthony: I have done this with 100 plus machines at the same time and it worked well and provided some useful feedback.
  • A Try Catch example in Katalon Studio (3)
    • Venkatesh: Hi Don Pedro Can you share me sample project ….which consist of basic to advanced stuff…If your github or gitlab url aso present please share… As I am beginer to this I need to learn lot
    • Don Pedro: Hi Lucas. Thank you for the kind comments. I would be happy to help. Let me know how I could be of assistance.
    • Lucas: Thanks for sharing a lot of Katalon tips and tricks. The Katalon team highly appreciate your support and feedback. To make Katalon Studio better and be the best free automation solution for testing community, we wish to coordinate...
  • Securely storing passwords and login details with Set Encrypted Text in Katalon Studio (1)
    • Agus: Hi Don, Is there a way to set the encrypted text to be used in the ‘WebUI.authenticate̵ 7; method? Basically I am trying to encrypt the password that is passed to the ‘WebUI.authenticate̵ 7; method. Thank you.
  • Katalon Studio – Manual View – The start of a test script (2)
    • ben: Hello Don Great Website. Keep up the work. I learnt a lot. cheers Ben.
    • Lucas: Hi Don Pedro, Thanks for sharing a lot of great articles related to Katalon Studio and Selenium. I am Lucas from Katalon team. From your point of view, we’ve learnt alot to improve our product and add more valuable features...
  • Another success with Katalon Studio (1)
    • Mahesh Joshi: Hi Don, I just started following your blog in regards to katalon. I want to introduce katalon studio at my work we do manual testing at work at the moment. What approach I should use for proof of concept with katalon for...
  • What went wrong with Crime City? (34)
    • G D: One thing I have noticed is the awkwardness of items and the attack points and how you can earn them. I was pretty pathetic with attack points and then I played that limited time boss and got weapons that had attack points in the...
  • Disable the Quicken 2012 Registration Prompt (1)
    • Scott: Thanks this worked great and is better then having to upgrade to a subscription!