codeforequity-at / botium-bindings

The Selenium for Chatbots
http://www.botium.at
MIT License
108 stars 33 forks source link

Postbacks in fbdirect #88

Open anton-gr opened 6 years ago

anton-gr commented 6 years ago

Hi,

I'm playing around with the sample fbdirect and it works fine with my Facebook bot with single text as the request. But when I'm trying to send postback with payload like:

#me
{
  "postback": {
    "payload": "Some payload"
  }
}

#bot
Hi

my webhook receives no requests. Could you please assist how to send postbacks in fbdirect mode?

Thanks

Log: info login Logging in... info login Logged in info login Request to reconnect info login Request to pull 1 info login Request to pull 2 info login Request to thread_sync info login Done logging in. botium-FbContainer logging into facebook ready +4s testmybot-main running testcase 1 simplecalc +5s botium-Convo simplecalc/Line 10: user says ConvoStep { botium-Convo sender: 'me', botium-Convo channel: null, botium-Convo messageText: undefined, botium-Convo sourceData: { postback: { payload: 'Some payload' } }, botium-Convo stepTag: 'Line 10', botium-Convo not: false } +0ms botium-Convo simplecalc wait for bot null +1ms verb parseAndCheckLogin for (;;); {"t":"lb","lb_info":{"sticky":"116","pool":"frc3c09_chat-proxy"}} info listen Got answer in 1086 verb parseAndCheckLogin for (;;); {"t":"msg","seq":2,"u":100022186592372,"ms":[{"type":"qprimer","made":"1528979655753"},{"type":"chatproxy-presence","buddyList":{"100003867865366":{"lat":1528975383},"633289663":{"lat":1528978677,"p":0,"vc":74},"100000487878525":{"lat":1528964405},"100000206799455":{"lat":1528978191},"100010071075103":{"lat":1528880316},"100001539813339":{"lat":1528979480,"p":2,"vc":0},"1614563253":{"lat":1528976904},"100001634492156":{"lat":1528975456},"100007152941774":{"lat":1528957755},"100023696302865":{"lat":1528976233},"1350133715":{"lat":1528952363},"100001586754582":{"lat":1528976173,"p":0,"vc":74},"100008372501565":{"lat":1528895349},"100001867372118":{"lat":1528951938},"100008021356269":{"lat":1528973417},"100015217624961":{"lat":1528965640},"100009864851286":{"lat":-1},"100000332668840":{"lat":-1},"1412043987":{"lat":1528977813},"100001452100429":{"lat":1528922061},"100001654392863":{"lat":1528830352},"100002125018927":{"lat":1528969407}},"userIsIdle":false,"chatNotif":0,"gamers":[]}]} info listen Got answer in 288 verb parseAndCheckLogin for (;;); {"t":"heartbeat"} verb parseAndCheckLogin info listen Got answer in 50493 botium-BaseContainer WaitBotSays error Error: Queue.pop timeout after 60000

sarjit07 commented 6 years ago

Facing the same issue. @codeforequity-at please suggest some fix.

codeforequity-at commented 6 years ago

The "fbdirect" connector is extremly limited - it is based on a library which mimicks the communication done with the facebook messenger web application and is not officially supported by Facebook. Things like postbacks and most kind of attachments currently cannot be handled with it (and probably never will).

I recommend switching to another connector type - depending on how your chatbot has been developed, there are other test automation options for sure.

codeforequity-at commented 6 years ago

By the way, we are currently working an integrating Botium with Selenium and Appium (https://github.com/codeforequity-at/botium-connector-webdriverio) - I think for the use cases you mentioned above, this would be the better approach.