Let’s get started with the ProjectCapabilities class. The ProjectCapabilities class will return the Desired Capabilities, TestBase will be a base class for our test for scaffolding the test setup and teardown, and lastly the GoogleNewsAndroidTest class will inherit from our TestBase, use the Desired Capabilities, and contain our test logic. We will structure the project in these three classes to make the organization clear. Select Gradle and under Additional Libraries and Frameworks select Kotlin/JVM.
In IntelliJ IDE, navigate to File > New Project. IntelliJ has a free community version called IntelliJ IDEA CE, which can be downloaded from their website or via your package manager. Kotlin is fully compatible with Java so we can fortunately leverage the Appium Java client and JUnit libraries in addition to writing our code in the IntelliJ IDE. I’ll be using the Google News Android app as the target for this example and test on a real Google Pixel 3 XL from the HeadSpin platform. I’d like to share the basics of getting started with writing an Appium test in Kotlin. Having the app code and UI automation code in the same language helps engineering and QA teams level set on the critical user journeys being tested. Perhaps your Android app team has incrementally added Kotlin code to your project or have elected to start new Android projects in Kotlin moving forward.
#Vspd not set for android#
Google officially adopted Kotlin by adding support into Android Studio in 2017 and since then has announced it as the preferred language for Android developers at Google I/O 2019. Kotlin is a modern programming language that focuses on conciseness, clarity, and code safety.