Skip to main content

2 posts tagged with "kotlin"

View All Tags

Type Inference and Basic Types in Kotlin

· 9 min read
Attila Fazekas
Kolibrium maintainer

Introduction

In our first post, we explored a small Selenium test written in Kotlin and highlighted several language features that make test code more concise and expressive. But there was one feature working behind the scenes that we didn't explicitly call out: type inference.

If you copied the example into IntelliJ IDEA and had Function return types inlay hints enabled (Settings → Editor → Inlay Hints → Types → Kotlin → Function return types), you might have noticed the Unit keyword appearing after the login function signature:

Type Inference Inlay Hint

In this post, we'll explore what type inference is, how it works in Kotlin, and cover the basic types you'll encounter most frequently when writing test automation code. Understanding these fundamentals will make the rest of your Kotlin journey much smoother.

A Tester's First Taste of Kotlin

· 11 min read
Attila Fazekas
Kolibrium maintainer

Introduction: Why Kotlin is a Great Fit for Test Automation

Kotlin is a modern, pragmatic language that runs on the JVM and works seamlessly with the entire Java test ecosystem. For testers, that means you can keep using familiar tools like Selenium, JUnit, TestNG, Appium, RestAssured, or Playwright for JVM — but write your tests in a language that removes much of Java's ceremony and friction. Kotlin's concise syntax, expressive constructs, and built-in safety features let you focus more on the behavior you want to test and less on boilerplate.

Many testers begin with Java because that's what their automation framework or company uses; Kotlin builds on that foundation rather than replacing it. You write fewer lines of code, avoid accidental null-safety issues, get cleaner page objects, and can express test intent more clearly. These benefits apply strongly to test automation, where readability and maintainability matter just as much as correctness. In this post, you'll get a first taste of what Kotlin looks like in a typical Selenium test and see how many of Kotlin's strengths naturally surface even in a small example.