christian-bromann / appium-hbbtv-driver

Automation for HBBTV apps
Apache License 2.0
19 stars 0 forks source link

No automation script was injected yet #7

Closed guillemhs closed 6 years ago

guillemhs commented 6 years ago

Hi,

I am trying to reproduce your setup but I cannot inject the automation script on a Samsung Smart TV 2016 UE32J5500AK. Then, I execute the following command and the error I get on the client is as follows:

pi@raspberrypi:~/appium-hbbtv-driver/demo $ wdio wdio.conf.js 
[11:55:19]  COMMAND POST     "/wd/hub/session"
[11:55:19]  DATA        {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"TV","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.12.0","name":"webdriverio"}}}
ERROR: An unknown server-side error occurred while processing the command. Original error: No connection to OTT device after 10000ms .. aborting
tv
    at new RuntimeError (/home/pi/.nvm/versions/node/v7.8.0/lib/node_modules/webdriverio/build/lib/utils/ErrorHandler.js:144:12)
    at Request._callback (/home/pi/.nvm/versions/node/v7.8.0/lib/node_modules/webdriverio/build/lib/utils/RequestHandler.js:316:39)
    at Request.self.callback (/home/pi/.nvm/versions/node/v7.8.0/lib/node_modules/webdriverio/node_modules/request/request.js:186:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:194:7)
    at Request.<anonymous> (/home/pi/.nvm/versions/node/v7.8.0/lib/node_modules/webdriverio/node_modules/request/request.js:1163:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:191:7)
    at IncomingMessage.<anonymous> (/home/pi/.nvm/versions/node/v7.8.0/lib/node_modules/webdriverio/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:293:19)

And I get this error on the server side

pi@raspberrypi:~/appium-hbbtv-driver $ npm start

> appium-hbbtv-driver@18.4.6 start /home/pi/appium-hbbtv-driver
> npm run start:server

> appium-hbbtv-driver@18.4.6 start:server /home/pi/appium-hbbtv-driver
> node build/index.js

info appium-hbbtv-driver:Settings No settings file found or file was corrupted
info devtools-backend:Proxy Start proxy server on localhost
info devtools-backend:Proxy Starting preflight checks ...
info appium-hbbtv-driver:Router Register route: GET /favicon.ico
info appium-hbbtv-driver:Router Register route: GET /settings
info appium-hbbtv-driver:Router Register route: POST /settings
info appium-hbbtv-driver:Router Register route: GET /nodeconfig.json
info appium-hbbtv-driver HbbTVDriver server listening on http://0.0.0.0:4723
info devtools-backend Started devtools-backend server on 0.0.0.0:9222
info devtools-backend:Proxy Preflight check successful
info HTTP --> POST /wd/hub/session
info HTTP {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"TV","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.12.0","name":"webdriverio"}}}
dbug MJSONWP Calling HbbTVDriver.createSession() with args: [{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"TV","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.12.0","name":"webdriverio"}},null,null,null,null]
WARN BaseDriver The following capabilities were provided, but are not recognized by appium: javascriptEnabled, locationContextEnabled, handlesAlerts, rotatable, browserName, loggingPrefs, requestOrigins.
info BaseDriver Session created with session id: 1828df9a-88ac-4ca9-92e8-4e246b2d5a08
info appium-hbbtv-driver:driver.js No automation script was injected yet, please restart your HbbTV app by pressing on the "EXIT" button to give the driver control over the page.
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
ERR! appium-hbbtv-driver:driver.js Error: No connection to OTT device after 10000ms .. aborting
ERR! appium-hbbtv-driver:driver.js     at Timeout._onTimeout (/home/pi/appium-hbbtv-driver/build/driver.js:573:51)
ERR! appium-hbbtv-driver:driver.js     at ontimeout (timers.js:386:14)
ERR! appium-hbbtv-driver:driver.js     at tryOnTimeout (timers.js:250:5)
ERR! appium-hbbtv-driver:driver.js     at Timer.listOnTimeout (timers.js:214:5)
ERR! appium-hbbtv-driver:driver.js  Error: No connection to OTT device after 10000ms .. aborting
ERR! appium-hbbtv-driver:driver.js     at Timeout._onTimeout (/home/pi/appium-hbbtv-driver/build/driver.js:573:51)
ERR! appium-hbbtv-driver:driver.js     at ontimeout (timers.js:386:14)
ERR! appium-hbbtv-driver:driver.js     at tryOnTimeout (timers.js:250:5)
ERR! appium-hbbtv-driver:driver.js     at Timer.listOnTimeout (timers.js:214:5)
ERR! MJSONWP Encountered internal error running command: Error: No connection to OTT device after 10000ms .. aborting
ERR! MJSONWP     at Timeout._onTimeout (/home/pi/appium-hbbtv-driver/build/driver.js:573:51)
ERR! MJSONWP     at ontimeout (timers.js:386:14)
ERR! MJSONWP     at tryOnTimeout (timers.js:250:5)
ERR! MJSONWP     at Timer.listOnTimeout (timers.js:214:5)
info HTTP <-- POST /wd/hub/session 500 10800 ms - 190
info HTTP 

Do you know how can I fix this?

I hope to hearing from you,

Best regards,

christian-bromann commented 6 years ago

See checking for page connection, press "EXIT" on remote control ... .. you need to press the EXIT button in order to reload the HBBTV app and inject the script.

guillemhs commented 6 years ago

How do I inject the script? Can I run the test on Java and not using Mocha?

christian-bromann commented 6 years ago

How do I inject the script?

As I said, by pressing the EXIT button on the remote control so the HbbTV app reloads.

Can I run the test on Java and not using Mocha?

You can use any test framework and any language you want.

guillemhs commented 6 years ago

But on Java, what driver do I use? What capabilities do I type? I saw BrowserName = TV, is this the only one I need?

christian-bromann commented 6 years ago

But on Java, what driver do I use?

One that can speaks Appium.

What capabilities do I type?

The same as with JS. Not sure if they are predefined and TV caps are not supported. Never use Java.

I saw BrowserName = TV, is this the only one I need?

Not sure what you mean by that

guillemhs commented 6 years ago

On wdio.conf.js you only say this...

    capabilities: [{
        browserName: 'TV'
    }],

That is the only capability you use on the test.

BTW, I run it on a Samsung TV, is there any brand that your example is not supporting?

christian-bromann commented 6 years ago

Your capabilities don't matter when you are directly connected to the Pi. If you use a Selenium Grid it is gonna be important.

BTW, I run it on a Samsung TV, is there any brand that your example is not supporting?

Not sure. Depends what browser is running on the TV. There might be old models that do not have support. In theory though every device can be supported.

guillemhs commented 6 years ago

What TV did you use on your demo?

christian-bromann commented 6 years ago

What TV did you use on your demo?

Which demo? I think I used it on an LG, Samsung and Philipps but as I mentioned before the TV manufacturer is not important. It should work everywhere. I will close this issue.

guillemhs commented 6 years ago

Hi @christian-bromann

I have the same configuration you have, I even bought the usb ethernet adapter you recommend and I still have the same problem

info appium-hbbtv-driver:Settings No settings file found or file was corrupted
info devtools-backend:Proxy Start proxy server on 192.168.0.3
info devtools-backend:Proxy Starting preflight checks ...
info appium-hbbtv-driver:Router Register route: GET /favicon.ico
info appium-hbbtv-driver:Router Register route: GET /settings
info appium-hbbtv-driver:Router Register route: POST /settings
info appium-hbbtv-driver:Router Register route: GET /nodeconfig.json
info appium-hbbtv-driver HbbTVDriver server listening on http://0.0.0.0:4723
info devtools-backend Started devtools-backend server on 0.0.0.0:9222
info devtools-backend:Proxy Preflight check successful
info HTTP --> POST /wd/hub/session
info HTTP {"desiredCapabilities":{"browserName":"TV"},"capabilities":{"desiredCapabilities":{"browserName":"TV"},"firstMatch":[{"browserName":"TV"}]}}
dbug MJSONWP Calling HbbTVDriver.createSession() with args: [{"browserName":"TV"},null,{"desiredCapabilities":{"browserName":"TV"},"firstMatch":[{"browserName":"TV"}]},null,null]
WARN BaseDriver The following capabilities were provided, but are not recognized by appium: browserName.
info BaseDriver Session created with session id: 66122ab1-778b-4911-acf1-fa39da9f52ea
info appium-hbbtv-driver:driver.js No automation script was injected yet, please restart your HbbTV app by pressing on the "EXIT" button to give the driver control over the page.
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
info appium-hbbtv-driver:driver.js checking for page connection, press "EXIT" on remote control ...
ERR! appium-hbbtv-driver:driver.js Error: No connection to OTT device after 10000ms .. aborting
ERR! appium-hbbtv-driver:driver.js     at Timeout._onTimeout (/root/appium-hbbtv-driver/build/driver.js:573:51)
ERR! appium-hbbtv-driver:driver.js     at ontimeout (timers.js:386:14)
ERR! appium-hbbtv-driver:driver.js     at tryOnTimeout (timers.js:250:5)
ERR! appium-hbbtv-driver:driver.js     at Timer.listOnTimeout (timers.js:214:5)
ERR! appium-hbbtv-driver:driver.js  Error: No connection to OTT device after 10000ms .. aborting
ERR! appium-hbbtv-driver:driver.js     at Timeout._onTimeout (/root/appium-hbbtv-driver/build/driver.js:573:51)
ERR! appium-hbbtv-driver:driver.js     at ontimeout (timers.js:386:14)
ERR! appium-hbbtv-driver:driver.js     at tryOnTimeout (timers.js:250:5)
ERR! appium-hbbtv-driver:driver.js     at Timer.listOnTimeout (timers.js:214:5)
ERR! MJSONWP Encountered internal error running command: Error: No connection to OTT device after 10000ms .. aborting
ERR! MJSONWP     at Timeout._onTimeout (/root/appium-hbbtv-driver/build/driver.js:573:51)
ERR! MJSONWP     at ontimeout (timers.js:386:14)
ERR! MJSONWP     at tryOnTimeout (timers.js:250:5)
ERR! MJSONWP     at Timer.listOnTimeout (timers.js:214:5)
info HTTP <-- POST /wd/hub/session 500 10873 ms - 190
info HTTP 

I am using your github code, I am also using node 7.8.0 for appium-hbbtv and node 8.2.1 for you devtools-backend, but when I try to run the test I cannot start the app.

When does your test start? on the DVB channel and then it clicks the red button or does it start directly on the HBB tv app already open?

Best regards,

christian-bromann commented 6 years ago

When does your test start? on the DVB channel and then it clicks the red button or does it start directly on the HBB tv app already open?

I has to have a HbbTV ready channel opened so that the proxy was able to inject the instrumentation script at least once.