Skip to main content

Extract Text Between Delimiters in Scenario Editor

var

Extract str="CartText savedBetween asDelimiters Quotein NoScenario :14393430*";Editor

varUse mySubStringdelimiter-based =extraction str.substring(str.lastIndexOf(":") + 1,str.lastIndexOf("*"));

You can use the below code to retrievewhen the value needed by a test appears between ":"two stable characters or strings.

  • Confirm the start and "*"end delimiters
    are
    stable across environments.
  • Handle missing or repeated delimiters predictably.
  • Trim only whitespace that is not part of the expected value.
  • Avoid delimiter extraction when a structured field or locator is available.

Validation workflow

  1. Capture the source text.
  2. Identify the start and end delimiters.
  3. Extract and normalize the value.
  4. Validate the extracted value or store it for later steps.

Last updated: JuneSeptember 26,20, 20232026

If you have any feedback on this topic, please contact us at documentation@appvance.ai