How to use custom functions from JS file in Test Designer
Use
Use customWe JavaScriptare helpers only when a reusable function is needed andcalling the behavior cannot be expressed clearly with standard Scenario Editor steps.
Recommended guidance
Keep helper functions small, named clearly, and scoped to reusable logic.Do not embed credentials, tenant URLs, or environment-specific values in helper files.Version helper files with the scenario or project maintenance process.Prefer built-in Scenario Editor capabilities when they are sufficient.
Validation workflow
Define the helperJS functionand expected inputs.Validate it with a small controlled example.Call itfrom thescenarioDSwherescript and it returns thereusablevaluesbehaviorafter evaluation
The JS function that we have created is needed.
This function will calculate a 10% discount on a Price that is entered. The usage of function in TD script is shown below
2. We can also make use of the Custom JS action in DS and failuresthen beforefetch the value using itthe inlocker
Last updated: SeptemberJune 20,26, 20262023
If you have any feedback on this topic, please contact us at documentation@appvance.ai