🏗️Web Tailor-Made coding

Overview

"Web Tailor-Made Coding" in our automated testing framework allows for the integration of custom, user-defined methods into the testing process. This feature is designed to enhance the flexibility and capability of your automated tests, enabling you to execute specific actions that are not covered by the standard functionalities.

How It Works

Custom methods are defined in user-created classes and are referenced in the test scripts via a CSV file. The framework recognizes these custom methods and executes them at the specified points in the test.

CSV File Configuration

The integration of custom methods into the test script is managed through specific entries in a CSV file. Here's how you can set it up:

  • Example Entry:

    PAGE_NAME,WAIT_TYPE,SCROLL_TYPE,ELEMENT_NAME,ACTIONS,SEND_KEYS,VALIDATION,VALIDATION_TYPE
    NONE,NONE,NONE,NONE,CUSTOM,CustomClass:getSavedVariables,NONE,NONE
  • Key Columns:

    • ACTIONS: Specifies the type of action to perform. For custom actions, this is set to CUSTOM.

    • SEND_KEYS: Includes the name of the custom class and the method to be invoked, formatted as ClassName:MethodName.

Creating a Custom Class

  • Example Custom Class:

    package test.java;
    
    import main.java.com.precisiontestautomation.automation.utils.KeyInitializers;
    
    public class CustomClass {
    
        public void getSavedVariables(){
            System.out.println(KeyInitializers.getGlobalVariables().get().get("testFrameName"));
        }
    }
  • Functionality:

    • In the provided example, CustomClass contains a method getSavedVariables, which retrieves and prints a saved variable from globalVariables.

Usage in Testing

  • During the test execution, when the framework encounters the CUSTOM action in the CSV file, it dynamically invokes the specified method from the custom class.

  • This approach allows the test to perform specialized actions that are tailored to specific testing requirements.

Benefits

  • Flexibility: Enables the execution of unique test steps that are not possible with standard test actions.

  • Reusability: Custom classes and methods can be reused across different test scripts.

  • Extended Functionality: Provides an avenue to extend the testing framework's capabilities to meet specific testing needs.

Conclusion

"Web Tailor-Made Coding" is a powerful feature that adds a significant degree of customization and flexibility to your automated testing processes. By allowing the integration of custom methods, it ensures that the testing framework can cater to a wide range of testing scenarios, thus enhancing the overall effectiveness and efficiency of the testing process.

Last updated

Was this helpful?