Is there any way to print out something in console/result file from botium scripts?

Hi,

I am generating user ids dynamically using
#begin
UPDATE_CUSTOM FBWEBHOOK_USERID|BOTIUM$random(10)

I wanted to print them out in the result file. Is there any way to do this?

You can add a logic hook like this to print something

{
  "botium": {
    "Capabilities": {
      ...
      "LOGIC_HOOKS": [
        {
          "ref": "DUMP_FBUSERID",
          "src": {
            "onMeStart": "console.log('DUMP_FBUSERID', meMsg.FBWEBHOOK_USERID)"
          },
          "global": true
        }
      ]
    }
  }
}

1 Like

@Florian thanks again.

This is working as expected but it is printing userid on each messages when #me is encountered which is as expected as per the code.

Is there any way to print it out once per testcase?

Could be done with something like this:

        "onMeStart": "if (meMsg.FBWEBHOOK_USERID && !convo.skipDumpUser) { console.log('DUMP_FBUSERID', meMsg.FBWEBHOOK_USERID); convo.skipDumpUser = true; } "

This is exactly what I wanted. Thanks a lot. Also, could you help me pointing any direction to print this out in mochawesome reports as well. firstly, is it possible??

dont think that this is possible