How can I use wildcards for audio Media in convo file in Botium?

I have created a mirror post in Stack Overflow, but putting it here as well JIC!

I have created a folder in specs/convo/audiodirectory, which contains some .wav files. Then I have a convo file which looks like this:

Utterance hit's relevant intent

#me
MEDIA audiodirectory/*.wav

#bot
INTENT RelevantIntent

My botium.json looks like this:

{
  "botium": {
    "Capabilities": {
      "PROJECTNAME": "Botium Project Lex",
      "CONTAINERMODE": "lex",
      "LEX_VERSION": "V2",
      "LEX_REGION": "[REDACTED]",
      "LEX_ACCESS_KEY_ID": "[REDACTED]",
      "LEX_SECRET_ACCESS_KEY": "[REDACTED]",
      "LEX_PROJECT_NAME": "[REDACTED]",
      "LEX_PROJECT_ALIAS": "[REDACTED]",
      "LEX_LOCALE": "en_GB",
      "LEX_ACCEPT": "audio/pcm",
      "USER_INPUTS": [
        {
          "ref": "MEDIA",
          "src": "MediaInput",
          "args": {
            "downloadMedia": true
          }
        }
      ]
    }
  }
}

However, when I run botium-cli run, I receive an error: ENOENT: no such file or directory, open ‘C:\Users[REDACTED]\botium-cli-test\specs\convo\audiodirectory*.wav’

I am following this part of the docs for reference: Technical Reference — Botium documentation

Where am I going wrong here?

hello,
cannot see any obvious fault on your side here. can you please add the –verbose switch to botium-cli and post the output. tanks

nice username btw :slight_smile:

1 Like

botium-cli Using Botium configuration file ./botium.json +0ms

  botium-cli-run command options: {

  botium-cli-run   _: [ 'run' ],

  botium-cli-run   verbose: true,

  botium-cli-run   v: true,

  botium-cli-run   convos: [ '.' ],

  botium-cli-run   C: [ '.' ],

  botium-cli-run   config: './botium.json',

  botium-cli-run   c: './botium.json',

  botium-cli-run   output: 'spec',

  botium-cli-run   testsuitename: 'Botium Test-Suite',

  botium-cli-run   n: 'Botium Test-Suite',

  botium-cli-run   expandutterances: false,

  botium-cli-run   expandscriptingmemory: false,

  botium-cli-run   timeout: 60,

  botium-cli-run   '$0': '..\\..\\AppData\\Roaming\\npm\\node_modules\\botium-cli\\bin\\botium-cli.js'

  botium-cli-run } +0ms

  botium-cli-run Mocha Reporter "spec", options: undefined +1ms

  botium-core-BotDriver Loaded Botium configuration files C:\Users\[REDACTED]\botium-cli-test\botium.json +0ms

  botium-core-asserterUtils MEDIA userinput already exists, overwriting. +0ms

  botium-core-ScriptingProvider ReadConvosFromDirectory(.) found filenames: botium.json,readme.md,specs/convo/give_me_a_picture.convo.txt +0ms

  botium-core-ScriptingProvider ReadConvosFromDirectory(.) found convos:

  botium-core-ScriptingProvider  1 give me picture ({ convoDir: '.', filename: 'specs/convo/give_me_a_picture.convo.txt' }): Line 3: #me -  MEDIA(audiodirectory/*.wav) | Line 6: #bot -  INTENT(LostIntent) +11ms

  botium-core-ScriptingProvider ReadConvosFromDirectory(.) found utterances:

  botium-core-ScriptingProvider  none +0ms

  botium-core-ScriptingProvider ReadConvosFromDirectory(.) found partial convos:

  botium-core-ScriptingProvider  none +0ms

  botium-core-ScriptingProvider ReadConvosFromDirectory(.) scripting memories:

  botium-core-ScriptingProvider  none +0ms

  botium-cli-run ready reading convos (1), expanding convos ... +189ms

  botium-core-ScriptingProvider ExpandConvos - Using utterances expansion mode: all +1ms

  botium-cli-run ready expanding convos and utterances, number of test cases: (1). +16ms

  botium-cli-run adding test case give me picture (from: { convoDir: '.', filename: 'specs/convo/give_me_a_picture.convo.txt' }) +2ms

  Botium Test-Suite

  botium-core-BotDriver Build - Botium Core Version: 1.11.15 +219ms

  botium-core-BotDriver Build - Capabilites: {

  botium-core-BotDriver   PROJECTNAME: 'Botium Project Lex',

  botium-core-BotDriver   TESTSESSIONNAME: 'Botium Test Session',

  botium-core-BotDriver   TESTCASENAME: 'Botium Test Case',

  botium-core-BotDriver   TEMPDIR: 'botiumwork',

  botium-core-BotDriver   CLEANUPTEMPDIR: true,

  botium-core-BotDriver   WAITFORBOTTIMEOUT: 10000,

  botium-core-BotDriver   SIMULATE_WRITING_SPEED: false,

  botium-core-BotDriver   SIMPLEREST_PING_RETRIES: 6,

  botium-core-BotDriver   SIMPLEREST_PING_TIMEOUT: 10000,

  botium-core-BotDriver   SIMPLEREST_PING_VERB: 'GET',

  botium-core-BotDriver   SIMPLEREST_PING_UPDATE_CONTEXT: true,

  botium-core-BotDriver   SIMPLEREST_PING_PROCESS_RESPONSE: false,

  botium-core-BotDriver   SIMPLEREST_INIT_PROCESS_RESPONSE: false,

  botium-core-BotDriver   SIMPLEREST_STOP_RETRIES: 6,

  botium-core-BotDriver   SIMPLEREST_STOP_TIMEOUT: 10000,

  botium-core-BotDriver   SIMPLEREST_STOP_VERB: 'GET',

  botium-core-BotDriver   SIMPLEREST_START_RETRIES: 6,

  botium-core-BotDriver   SIMPLEREST_START_TIMEOUT: 10000,

  botium-core-BotDriver   SIMPLEREST_START_UPDATE_CONTEXT: true,

  botium-core-BotDriver   SIMPLEREST_START_PROCESS_RESPONSE: true,

  botium-core-BotDriver   SIMPLEREST_START_VERB: 'GET',

  botium-core-BotDriver   SIMPLEREST_POLL_VERB: 'GET',

  botium-core-BotDriver   SIMPLEREST_POLL_INTERVAL: 1000,

  botium-core-BotDriver   SIMPLEREST_POLL_UPDATE_CONTEXT: true,

  botium-core-BotDriver   SIMPLEREST_METHOD: 'GET',

  botium-core-BotDriver   SIMPLEREST_IGNORE_EMPTY: true,

  botium-core-BotDriver   SIMPLEREST_TIMEOUT: 10000,

  botium-core-BotDriver   SIMPLEREST_EXTRA_OPTIONS: {},

  botium-core-BotDriver   SIMPLEREST_STRICT_SSL: true,

  botium-core-BotDriver   SIMPLEREST_INBOUND_UPDATE_CONTEXT: true,

  botium-core-BotDriver   SIMPLEREST_CONTEXT_MERGE_OR_REPLACE: 'MERGE',

  botium-core-BotDriver   SCRIPTING_TXT_EOL: '\n',

  botium-core-BotDriver   SCRIPTING_XLSX_EOL_WRITE: '\r\n',

  botium-core-BotDriver   SCRIPTING_XLSX_HASHEADERS: true,

  botium-core-BotDriver   SCRIPTING_CSV_SKIP_HEADER: true,

  botium-core-BotDriver   SCRIPTING_CSV_QUOTE: '"',

  botium-core-BotDriver   SCRIPTING_CSV_ESCAPE: '"',

  botium-core-BotDriver   SCRIPTING_NORMALIZE_TEXT: true,

  botium-core-BotDriver   SCRIPTING_ENABLE_MEMORY: false,

  botium-core-BotDriver   SCRIPTING_ENABLE_MULTIPLE_ASSERT_ERRORS: false,

  botium-core-BotDriver   SCRIPTING_MATCHING_MODE: 'wildcardIgnoreCase',

  botium-core-BotDriver   SCRIPTING_UTTEXPANSION_MODE: 'all',

  botium-core-BotDriver   SCRIPTING_UTTEXPANSION_RANDOM_COUNT: 1,

  botium-core-BotDriver   SCRIPTING_UTTEXPANSION_NAMING_MODE: 'justLineTag',

  botium-core-BotDriver   SCRIPTING_UTTEXPANSION_NAMING_UTTERANCE_MAX: '16',

  botium-core-BotDriver   SCRIPTING_MEMORYEXPANSION_KEEP_ORIG: false,

  botium-core-BotDriver   SCRIPTING_FORCE_BOT_CONSUMED: false,

  botium-core-BotDriver   ASSERTERS: [],

  botium-core-BotDriver   LOGIC_HOOKS: [],

  botium-core-BotDriver   USER_INPUTS: [ { ref: 'MEDIA', src: 'MediaInput', args: [Object] } ],

  botium-core-BotDriver   SECURITY_ALLOW_UNSAFE: true,

  botium-core-BotDriver   CONTAINERMODE: 'lex',

  botium-core-BotDriver   LEX_VERSION: 'V2',

  botium-core-BotDriver   LEX_REGION: 'eu-west-2',

  botium-core-BotDriver   LEX_ACCESS_KEY_ID: '[REDACTED]',

  botium-core-BotDriver   LEX_SECRET_ACCESS_KEY: '[REDACTED]',

  botium-core-BotDriver   LEX_PROJECT_NAME: '[REDACTED]',

  botium-core-BotDriver   LEX_PROJECT_ALIAS: '[REDACTED]',

  botium-core-BotDriver   LEX_LOCALE: 'en_GB',

  botium-core-BotDriver   LEX_ACCEPT: 'audio/pcm',

  botium-core-BotDriver   CONFIG: './botium.json'

  botium-core-BotDriver } +0ms

  botium-core-BotDriver Build - Sources : { LOCALPATH: '.', GITPATH: 'git', GITBRANCH: 'master', GITDIR: '.' } +6ms

  botium-core-BotDriver Build - Envs : { IS_BOTIUM_CONTAINER: true } +0ms

  botium-connector-PluginConnectorContainer-helper Botium plugin botium-connector-lex loaded. Plugin version is 0.1.0 +0ms

  botium-cli-run running testcase give me picture +49ms

  botium-core-Convo BotiumError: give me picture/Line 3: error sending to bot - downloadMedia failed: ENOENT: no such file or directory, open 'C:\Users\[REDACTED]\botium-cli-test\specs\convo\audiodirectory\*.wav'  

  botium-core-Convo     at botiumErrorFromErr (C:\[REDACTED]\npm\node_modules\botium-cli\node_modules\botium-core\src\scripting\BotiumError.js:85:12)

  botium-core-Convo     at Convo.runConversation (C:\[REDACTED]\npm\node_modules\botium-cli\node_modules\botium-core\src\scripting\Convo.js:349:31)

  botium-core-Convo     at async Convo.Run (C:\[REDACTED]\npm\node_modules\botium-cli\node_modules\botium-core\src\scripting\Convo.js:235:7) +0ms

  botium-cli-run give me picture failed: TranscriptError: give me picture/Line 3: error sending to bot - downloadMedia failed: ENOENT: no such file or directory, open 'C:\Users\[REDACTED]\botium-cli-test\specs\convo\audiodirectory\*.wav'

  botium-cli-run     at Convo.Run (C:\[REDACTED]\npm\node_modules\botium-cli\node_modules\botium-core\src\scripting\Convo.js:257:15) {

  botium-cli-run   transcript: Transcript {

  botium-cli-run     steps: [ [TranscriptStep] ],

  botium-cli-run     attachments: [],

  botium-cli-run     scriptingMemory: {},

  botium-cli-run     convoBegin: 2022-02-23T09:57:25.372Z,

  botium-cli-run     convoEnd: 2022-02-23T09:57:25.376Z,

  botium-cli-run     err: BotiumError: give me picture/Line 3: error sending to bot - downloadMedia failed: ENOENT: no such file or directory, open 'C:\Users\[REDACTED]\botium-cli-test\specs\convo\audiodirectory\*.wav'

  botium-cli-run         at botiumErrorFromErr (C:\[REDACTED]\npm\node_modules\botium-cli\node_modules\botium-core\src\scripting\BotiumError.js:85:12)

  botium-cli-run         at Convo.runConversation (C:\[REDACTED]\npm\node_modules\botium-cli\node_modules\botium-core\src\scripting\Convo.js:349:31)

  botium-cli-run         at async Convo.Run (C:\[REDACTED]\npm\node_modules\botium-cli\node_modules\botium-core\src\scripting\Convo.js:235:7) {

  botium-cli-run       context: [Object]

give me picture/Line 3: error sending to bot - downloadMedia failed: ENOENT: no such file or directory, open 'C:\Users\[REDACTED]\botium-cli-test\specs\convo\audiodirectory\*.wav'

      at wrapBotiumError (C:\[REDACTED]\npm\node_modules\botium-cli\src\run\index.js:76:12)

      at finish (C:\[REDACTED]\npm\node_modules\botium-cli\src\run\index.js:205:24)      at C:\[REDACTED]\npm\node_modules\botium-cli\src\run\index.js:218:11

screen-shot

If there are any working examples of this concept - then that would be great. I could certainly figure out my issue from there.

Prepared a sample repository:
Repl.it
Github Branch

1 Like

Got it working using this.

In my original codebase I wasn’t using any of the botium-bindings modules - just using pure CLI, so maybe this made a difference.

Thanks!

1 Like