Thursday, February 27, 2025

Maximo Test Automation with Karate testing platform

Maximo Test Automation, using Karate. Karate is the only open-source testing platform that seamlessly combines UI testing, API testing, API performance testing, and API mocks in a single framework.

In today's Agile practices, Maximo consultants must collaborate closely with Business Analysts, Testers and DevOps to understand required testing and identify automation opportunities for successful releases. Every release needs to pass essential milestones, such as Performance impact tests, Critical regression test cases and Defect closures. 

Given these trends, it's essential for a Maximo Consultant to possess proficiency in testing frameworks for UI, Unit and Integration testing, as well as familiarity of how these frameworks are integrated into CI/CD pipelines.

Tests in Karate framework can be created by non-programmers using Behavior Driven Development (BDD)  syntax, which is similar to Gherkin. This approach enables test automation without the need for coding skills

The tasks involved in Karate Test automation are as follows: 
  • Installation
  • Maven Project
  • .feature file 
  • Test Execution & Results
Installation:
  • Install Java & Configure Java path in System Environment Variable
  • Install Maven & Eclipse IDE
Maven is open-source build automation tool, mainly used for Java projects. It assists developers in managing the entire project lifecycle, including building, testing, packaging and deployment. 

  • Install Cucumber Plugin from Eclipse Marketplace
Cucumber plugin helps identify and execute feature files efficiently
Cucumber is a tool that facilitates Behavior Driven Development (BDD). Each scenario in Cucumber feature file consists of a series of steps that the tool uses to verify if the software meets the specified requirements, generating a report that indicates whether each scenario passes or fails. 

Maven project:

Create a Maven project by configuring the Karate dependency in pom.xml file. 
Maven provides a standardized way to handle project dependencies and project configuration through a POM (Project Object Model) file.



By adding a dependency for karate in pom.xml, Maven will automatically download all the necessary dependencies required to run tests using Karate framework.


.feature File

A .feature file in the Karate framework (or other BDD tools like Cucumber) contains Gherkin-style syntax, which is a human-readable format for defining the steps of a test scenario. Each step is then linked to programming code that implements the actual behavior of the test. 

UI Testing Scenario .feature file is to test create Work Order by login into Maximo, navigate to Work Order application from Start Center, enter the mandatory field values and save the record. 


API Testing Scenario .feature file is to validate the XML response from Maximo PERSON REST API GET Query. 


Test Execution & Results:
  • In your project, navigate to .feature file which you want to run.
  • Right click on the file
  • In Eclipse, you will see an option: Run As -> Cucumber Feature
  • Once you select it, the IDE will execute the feature file, and you should see the results in the Console window of your IDE

  • Karate framework generates a detailed test results report.
  • The summary of the test execution is stored in an HTML file, which you can easily view in a browser.
  • By default, Karate framework generates the test results in following path: "target/karate-reports/karate-summary.html"

A sample project demonstrating API & UI testing is available in gitlab repository gitlab-KarateMaximoAutomation 


References: