Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Apica custom Selenium scripting command getDictionary allows users to access a user-defined dictionary from inside a check scenario script. The getDictionary fetches the entire Dictionary (with all key/value pairs) and stores it locally for when the script executes. 

Using the getDictionary Command

Step 1: Create the Dictionary

  1. Create/Add a Dictionary using an API POST command

  2. Name the Dictionary Key that will be used to access this dictionary:

    1. "dictionary_key": "ExampleApicaKey","dictionary" {Name:value pairs}

    2. "dictionary_key": "ApicaKey","dictionary" {Name:value pairs}

    3. You will also provide string-pair values in the form of “targetstring1”: “targetvalue1” that will form the Keys that access the values needed:

      • “firstname”: “Doug”

      • “lastname”: “Smith”

      • “cardnumber”: “1234-1234-1234-1234”

      • “expdate”: “12/25”

  3. You must also provide a Description:

    1. e.g. "description": "Test Dictionary"

  4. In this example, the POST command is:

    1. POST scenarios/proxysniffer/dictionaries

  5. The POST body for one of the examples above is:

Code Block
{
  "dictionary_key": "DougApicaKey",   
  "dictionary": {
     “firstname”: “Doug”,
     "lastname”: “Smith”,
     "cardnumber”: “1234-1234-1234-1234"
  },
"description": "Test Dictionary"
}

Step 2: Retrieve the Dictionary

Once the above dictionary has been defined, the Selenium scripting command getDictionary allows access to the dictionary information from inside a check scenario script. The getDictionary command fetches the entire Dictionary (with all key/value pairs) and stores it locally for when the script executes. It uses the Apica Dictionaries GET API to get these dictionary values. The GET call will be in the form of

...

The getDictionary command then turns these key values into ASM variable names for use in the ASM script.

Example: Using the getDictionary Command within a Selenium Scenario

The getDictionary command expects two arguments when it fetches predefined variables from a dictionary:

...