Skip to main content

Ellithium Utilities

The Ellithium framework provides a comprehensive set of utility libraries that simplify common test automation tasks. These utilities make it easier to handle data, files, assertions, and system interactions in your test code.

Available Utilities

Data Processing

UtilityDescription
JSON HelperManipulate, read, and validate JSON data with support for nested structures, arrays, and complex operations.
Excel HelperRead and write Excel files using Apache POI with support for multiple sheets, formatting, and data manipulation.
CSV HelperProcess CSV files with methods for reading, writing, filtering, and transforming tabular data.
Text HelperHandle plain text file operations including reading, writing, searching, and manipulating content.
PDF HelperExtract text, manipulate pages, and validate content in PDF documents using Apache PDFBox.
Property HelperManage Java properties files with order preservation and enhanced functionality.

System Integration

UtilityDescription
JAR ExtractorExtract content from JAR files securely with protection against common vulnerabilities.
Command ExecutorRun OS commands with cross-platform support for Windows, macOS, and Linux.

Test Support

UtilityDescription
Test Data GeneratorGenerate realistic test data for various domains including personal info, addresses, and business data.
Assertion ExecutorPerform advanced assertions with detailed logging, supporting both hard and soft assertion modes.
Configuration PropertiesConfigure framework behavior through property files for logging, reporting, and execution settings.

Key Features

All utility classes in Ellithium share these common characteristics:

  1. Consistent Logging - Operations are logged through the Ellithium reporting system
  2. Error Handling - Robust error handling with meaningful error messages
  3. Thread Safety - Safe to use in parallel test execution environments
  4. Fluent API - Easy-to-use methods with intuitive naming
  5. Integration - Seamless integration with Ellithium test reports

Using Utilities in Your Tests

Importing and using utilities in your test code is straightforward:

import Ellithium.Utilities.generators.TestDataGenerator;
import Ellithium.Utilities.assertion.AssertionExecutor;
import Ellithium.Utilities.helpers.JsonHelper;

public class MyTest {
@Test
public void testUserRegistration() {
// Generate test data
String username = TestDataGenerator.getRandomUsername();
String email = TestDataGenerator.getRandomEmail();

// Create user and verify response
String response = userApi.createUser(username, email);

// Use JSON helper to parse and verify response
String userId = JsonHelper.getJsonKeyValue(response, "id");

// Use assertion executor for validation
AssertionExecutor.hard.assertNotNull(userId, "User ID should be generated");
AssertionExecutor.hard.assertTrue(userId.length() > 5, "User ID should be valid");
}
}

Best Practices

  • Import only the specific utilities needed in each test class
  • Consider creating wrapper classes for frequent utility operations in your specific domain
  • Use soft assertions with AssertionExecutor when validating multiple conditions
  • Combine test data generation with property files for reproducible test runs
  • Configure test behavior through the property files for consistent execution