0

For chatbot testing, We have http endpoints for chatbot, one of them posts message to chatbot and another one fetches messages from chatbot, In Botium, tried using simplerest(async api), but cant give two endpoints using generic http connectors, Any ideas please?

KSS
  • 3
  • 1

1 Answers1

0

Apart from the simple request/response mode, the Botium Generic HTTPS/JSON connector supports two other modes as well (see Botium Wiki):

Async Mode

In Async mode, the connector opens up an HTTP/JSON endpoint itself for the other end to post data to.

Polling Mode

In this mode, the connector polls an HTTP/JSON endpoint for responses. This can be different than the original outbound endpoint, so this might be what you are looking for.

Florian Treml
  • 1,315
  • 2
  • 7
  • 10
  • Thank you, i managed to call two end points, but i am not able to get response of second api(which is called using polling) using SIMPLEREST_RESPONSE_JSONPATH, as this returns only first api response. How can i get second api json response? Also i can't access https://botium.atlassian.net/wiki/spaces/BOTIUM/pages/24510469/Generic+HTTP+S+JSON+Connector, getting access restricted error – KSS Jun 12 '20 at 02:26
  • There is the capability "SIMPLEREST_BODY_JSONPATH" to split the response body into multiple parts. – Florian Treml Jun 12 '20 at 06:40
  • Thank you, Can you give me an example, My problem is, One of the api json (POST)response is, { "statusreference": "abkfhk667778787ajflafldfkdlf", "statuscheck": { "codes": "SUCCESS" } }. Polling api (GET method) returns, another different response which contains actual message returned from bot , i need to get polling api's response in jsonpath instead of first one,Thank you for quick responses :) – KSS Jun 13 '20 at 22:32
  • you can find a sample here: https://github.com/codeforequity-at/botium-core/tree/master/samples/connectors/simplerest-polling – Florian Treml Jun 14 '20 at 11:39
  • Thanks, I have added multiple jsonpaths, "SIMPLEREST_RESPONSE_JSONPATH": ["$.status.check","$.date.chats[3].text"], Can you give me an example to add assertion in convo file, #me TEST CLOSE AFTER READING #bot SUCCESS #bot SUCCESS #bot Welcome User, With this am not able to assert , it either fails with expecting success or expecting Welcome User.Expected bot response (on Line 3: #me - TEST MESSAGE) "SUCCESS" to match one of "Welcome User". – KSS Jun 15 '20 at 04:06
  • first of all, this is a matter of test case design. a test case should always have a defined outcome. if you need such kind of branches in the test case, it is a sign for bad test design. but if you are aware of that, you can use regular expressions or utterances lists for assertions as well. please see botium wiki. – Florian Treml Jun 15 '20 at 10:50