Code Editor

SimplifyQA's Code Editor feature allows users to write custom methods tailored to their application's unique behaviors. Whether you need to handle complex UI logic or external data processing, the Code Editor lets you extend test automation with Java-based scripting, AI assistance, and seamless integration with your test cases.

Prerequisites

Before using the Code Editor, make sure:

Download & Install Code Editor

  • Go to your User Profile

  • Click Settings and navigate to the Downloads section

  • Go to the Code Editor tab and click Download Installer. Choose the OS from the dropdown for either windows, MAC or Linux.

  • Install it for user level access.

  • Ensure installation is done in the default or pre-defined path.

Configure Code Editor from Admin Section

To use the Code Editor in SimplifyQA, it must be configured from the Admin section - either at the Project Level or the Customer Level. This setup defines where and how the Code Editor is accessible based on user roles and project requirements.

How to use the Code Editor?

  • Switch back to user mode.

  • Under Test Management, click Code Editor from the left panel.

  • Based on your configuration, you'll either see a project-specific folder or a customer-level folder.

  • Navigate to: src > main > SampleClass to view sample custom methods.

  • Write your custom methods in CustomMethods.java file or create your own java file and start writing the code in the format given below,

@SyncAction(uniqueId = "[unique id]",groupName = "Generic",objectTemplate = @ObjectTemplate(name = TechnologyType.GENERIC,description = "This action belongs to GENERIC"))
    
    public boolean customAddition(int... ints){
        driver.getGenericMethods().additionOfValues(ints);
        log.info("addition of values performed");
        return true;
    }

  • Below is the explanation of the above code:

    • @SyncAction: Annotation to define a reusable custom action that can be synced into SimplifyQA. Refer to How to Sync Actions using Code Editor? to learn more about sync annotation.

    • uniqueId: A unique identifier for the action to avoid conflicts during syncing.

    • groupName: The category under which the custom action will appear in test cases in SimplifyQA.

    • @ObjectTemplate: Defines the platform type and description for the custom action.

    • customAddition(int... ints): A method that adds multiple integer values provided at runtime.

    • driver: The main test driver object that enables method execution across platforms.

    • getGenericMethods(): Accesses SimplifyQA’s generic utility methods. Selecting getGenericMethods will display all actions in the 'Generic' object template. You can extend these actions to create your custom method.

    • additionOfValues(ints): A method that adds the provided integer values.

    • log.info("addition of values performed"): Logs a message indicating successful addition execution. Users can access execution logs directly from their agent folder. Navigate to: SimplifyQA > dist > [Project ID] > agent > logs

    • return true: Indicates successful completion of the custom method.

  • Save the file and run the command:

build.bat
  • When prompted with: "PLEASE SELECT: DO YOU WANT TO USE LOCAL JAR PRESENT IN TARGET FOLDER FOR EXECUTION? ENTER Y (for yes) OR N (for no):"

    Enter Y if you want to use your updated local JAR file for execution. This will save your changes and generate a new local JAR. ➤ Enter N if you prefer to use the existing cloud JAR. The tool will then download the current version from the cloud for execution.

Locate the Custom JAR File

  1. Navigate to the agent folder path: workspaces > [project_number] > project > target

  2. The newly created [Project_Name]-version-jar-with-dependencies.jar file with your custom methods will be here

Frequently Asked Questions (FAQs)

What is the Code Editor in SimplifyQA used for?

The Code Editor allows users to create custom methods tailored to specific application behaviours, enhancing flexibility in test automation.

How do I enable access to the Code Editor?

Admin privileges must be enabled either at the Project Level or Customer Level through the Roles & Privileges settings in SimplifyQA.

How do I push the updated custom code?

Use the command publish.bat. The first time, you'll be prompted to enter the GitLab URL, username, and token. After publishing, the updated code will be available under a newly created tag in GitLab.

Why do I need both Project-Level and Customer-Level configurations?
  • Project-Level: When customizations are unique to a single project.

  • Customer-Level: When the same logic needs to be reused across multiple projects for consistency.

Last updated