Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run main TV app in Chrome browser #142

Open
Chanak7 opened this issue Nov 17, 2022 · 7 comments
Open

Unable to run main TV app in Chrome browser #142

Chanak7 opened this issue Nov 17, 2022 · 7 comments

Comments

@Chanak7
Copy link

Chanak7 commented Nov 17, 2022

Hi team,

Can you please help me to check, why we are unable to run our TV app in the Chrome browser.

Appium verson: 2.0.0-beta.46
Windows 10: 21H2

Steps taken:

  1. This is the script we used:
const wd = require("webdriverio");

async function main() {
  const driver = await wd.remote({
    port: 4723,
    capabilities: {
      platformName: "TizenTV",
      "appium:automationName": "TizenTV",
      "appium:deviceName": "10.0.0.41:26101",
      "appium:chromedriverExecutable":
        "C:\\Users\\ckk\\Downloads\\appiumWithJS\\chromedriver.exe",
      "appium:noReset": true,
      "appium:appPackage": "agsyterusi8.HTML5",
    },
  });

  let page = await driver.getPageSource();
  console.log(page);
}

main(); 
  1. After running the code above. We get this page:

image

Below are the appium logs:

[Appium] Welcome to Appium v2.0.0-beta.46
[Appium] Attempting to load driver tizentv...
[debug] [Appium] Requiring driver at C:\Users\ckk\.appium\node_modules\appium-tizen-tv-driver
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[Appium] Available drivers:
[Appium]   - tizentv@0.7.3 (automationName 'TizenTV')
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
[HTTP] --> POST /session
[HTTP] {"capabilities":{"alwaysMatch":{"platformName":"TizenTV","appium:automationName":"TizenTV","appium:deviceName":"10.0.0.41:26101","appium:chromedriverExecutable":"C:\\Users\\ckk\\Downloads\\appiumWithJS\\chromedriver.exe","appium:noReset":true,"appium:appPackage":"agsyterusi8.HTML5"},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"TizenTV","appium:automationName":"TizenTV","appium:deviceName":"10.0.0.41:26101","appium:chromedriverExecutable":"C:\\Users\\ckk\\Downloads\\appiumWithJS\\chromedriver.exe","appium:noReset":true,"appium:appPackage":"agsyterusi8.HTML5"}}
[debug] [AppiumDriver@81c7] Calling AppiumDriver.createSession() with args: [{"platformName":"TizenTV","appium:automationName":"TizenTV","appium:deviceName":"10.0.0.41:26101","appium:chromedriverExecutable":"C:\\Users\\ckk\\Downloads\\appiumWithJS\\chromedriver.exe","appium:noReset":true,"appium:appPackage":"agsyterusi8.HTML5"},null,{"alwaysMatch":{"platformName":"TizenTV","appium:automationName":"TizenTV","appium:deviceName":"10.0.0.41:26101","appium:chromedriverExecutable":"C:\\Users\\ckk\\Downloads\\appiumWithJS\\chromedriver.exe","appium:noReset":true,"appium:appPackage":"agsyterusi8.HTML5"},"firstMatch":[{}]}]
[debug] [AppiumDriver@81c7] Event 'newSessionRequested' logged at 1668708643305 (18:10:43 GMT+0000 (Western European Standard Time))
[Appium] Attempting to find matching driver for automationName 'TizenTV' and platformName 'TizenTV'
[Appium] The 'tizentv' driver was installed and matched caps.
[Appium] Will require it at C:\Users\ckk\.appium\node_modules\appium-tizen-tv-driver
[debug] [Appium] Requiring driver at C:\Users\ckk\.appium\node_modules\appium-tizen-tv-driver
[AppiumDriver@81c7] Appium v2.0.0-beta.46 creating new TizenTVDriver (v0.7.3) session
[AppiumDriver@81c7] Checking BaseDriver versions for Appium and TizenTVDriver
[AppiumDriver@81c7] Appium's BaseDriver version is 8.7.3
[AppiumDriver@81c7] TizenTVDriver's BaseDriver version is 8.7.3
[debug] [TizenTVDriver@b819] Creating session with W3C capabilities: {
[debug] [TizenTVDriver@b819]   "alwaysMatch": {
[debug] [TizenTVDriver@b819]     "platformName": "TizenTV",
[debug] [TizenTVDriver@b819]     "appium:automationName": "TizenTV",
[debug] [TizenTVDriver@b819]     "appium:deviceName": "10.0.0.41:26101",
[debug] [TizenTVDriver@b819]     "appium:chromedriverExecutable": "C:\\Users\\ckk\\Downloads\\appiumWithJS\\chromedriver.exe",
[debug] [TizenTVDriver@b819]     "appium:noReset": true,
[debug] [TizenTVDriver@b819]     "appium:appPackage": "agsyterusi8.HTML5"
[debug] [TizenTVDriver@b819]   },
[debug] [TizenTVDriver@b819]   "firstMatch": [
[debug] [TizenTVDriver@b819]     {}
[debug] [TizenTVDriver@b819]   ]
[debug] [TizenTVDriver@b819] }
[TizenTVDriver@b819 (7673576c)] Session created with session id: 7673576c-8c82-4f81-b735-257215bea654
[TizenTVDriver] No udid and/or deviceAddress provided; attempting to derive from deviceName "10.0.0.41:26101"
[debug] [TizenTVDriver] Setting deviceAddress to "10.0.0.41"
[debug] [TizenTVDriver] Setting udid to "10.0.0.41:26101"
[TizenTVDriver] Running tizen app 'org.tizen.browser' on device '10.0.0.41:26101'
[TizenTVDriver] Attempting to verify location of the 'tizen' binary
[TizenTVDriver] Binary was found at C:\tizen-studio\tools\ide\bin\tizen.bat
[TizenTVDriver] Running command: C:\tizen-studio\tools\ide\bin\tizen.bat run -p org.tizen.browser -s 10.0.0.41:26101
[TizenTVDriver] Starting agsyterusi8.HTML5 in debug mode on 10.0.0.41:26101
[TizenTVDriver] Attempting to verify location of the 'sdb' binary
[TizenTVDriver] Binary was found at C:\tizen-studio\tools\sdb.exe
[TizenTVDriver] Running command: C:\tizen-studio\tools\sdb.exe -s 10.0.0.41:26101 shell 0 debug agsyterusi8.HTML5
[TizenTVDriver] Debug port opened on 45585
[TizenTVDriver] Chose local port 10076 for remote debug communication
[TizenTVDriver] Forwarding local TCP port 10076 to port 45585 on device 10.0.0.41:26101
[TizenTVDriver] Running command: C:\tizen-studio\tools\sdb.exe -s 10.0.0.41:26101 forward tcp:10076 tcp:45585
[debug] [Chromedriver@c0fb] Changed state to 'starting'
[Chromedriver@c0fb] Set chromedriver binary as: C:\Users\ckk\Downloads\appiumWithJS\chromedriver.exe
[debug] [Chromedriver@c0fb] Killing any old chromedrivers, running: wmic process where "commandline like '%chromedriver.exe%--port=10081%'" delete
[debug] [Chromedriver@c0fb] Successfully cleaned up old chromedrivers
[Chromedriver@c0fb] Spawning chromedriver with: C:\Users\ckk\Downloads\appiumWithJS\chromedriver.exe --port=10081 --verbose
[debug] [Chromedriver@c0fb] Chromedriver version: '2.29.461591'
[debug] [Chromedriver@c0fb] Chromedriver v. 2.29.461591 does not fully support W3C protocol. Defaulting to MJSONWP
[debug] [Chromedriver@c0fb] Matched '/status' to command name 'getStatus'
[debug] [Chromedriver@c0fb] Proxying [GET /status] to [GET http://127.0.0.1:10081/status] with no body
[debug] [Chromedriver@c0fb] Got response with status 200: {"sessionId":"","status":0,"value":{"build":{"version":"alpha"},"os":{"arch":"x86_64","name":"Windows NT","version":"10.0.19044"}}}
[Chromedriver@c0fb] Starting MJSONWP Chromedriver session with capabilities: {
[Chromedriver@c0fb]   "desiredCapabilities": {
[Chromedriver@c0fb]     "goog:chromeOptions": {
[Chromedriver@c0fb]       "debuggerAddress": "127.0.0.1:10076"
[Chromedriver@c0fb]     },
[Chromedriver@c0fb]     "loggingPrefs": {
[Chromedriver@c0fb]       "browser": "ALL"
[Chromedriver@c0fb]     }
[Chromedriver@c0fb]   }
[Chromedriver@c0fb] }
[debug] [Chromedriver@c0fb] Matched '/session' to command name 'createSession'
[debug] [Chromedriver@c0fb] Proxying [POST /session] to [POST http://127.0.0.1:10081/session] with body: {"desiredCapabilities":{"goog:chromeOptions":{"debuggerAddress":"127.0.0.1:10076"},"loggingPrefs":{"browser":"ALL"}}}
[debug] [Chromedriver@c0fb] Webview version: 'Chrome/56.0.2924.87'
[debug] [Chromedriver@c0fb] Got response with status 200: {"sessionId":"b9907c8b4008cc73f36f9f76f86b8061","status":0,"value":{"acceptSslCerts":true,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"browserName":"chrome","chrome":{"chromedriverVersion":"2.29.461591 (62ebf098771772160f391d75e589dc567915b233)","userDataDir":"C:\\Users\\ckk\\AppData\\Local\\Temp\\scoped_dir19124_1022"},"cssSelectorsEnabled":true,"databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platform":"Windows NT","rotatable":false,"takesHeapSnapshot":true,"takesScreenshot":true,"unexpectedAlertBehaviour":"","version":"56.0.2924.87","webStorageEnabled":true}}
[Chromedriver@c0fb] Determined the downstream protocol as 'MJSONWP'
[debug] [Chromedriver@c0fb (b9907c8b)] Changed state to 'online'
[AppiumDriver@81c7] New TizenTVDriver session created successfully, session 7673576c-8c82-4f81-b735-257215bea654 added to master session list
[debug] [AppiumDriver@81c7] Event 'newSessionStarted' logged at 1668708651305 (18:10:51 GMT+0000 (Western European Standard Time))
[debug] [TizenTVDriver@b819 (7673576c)] Cached the protocol value 'W3C' for the new session 7673576c-8c82-4f81-b735-257215bea654
[debug] [TizenTVDriver@b819 (7673576c)] Responding to client with driver.createSession() result: {"capabilities":{"appLaunchCooldown":3000,"rcMode":"js","platformName":"TizenTV","automationName":"TizenTV","deviceName":"10.0.0.41:26101","chromedriverExecutable":"C:\\Users\\ckk\\Downloads\\appiumWithJS\\chromedriver.exe","noReset":true,"appPackage":"agsyterusi8.HTML5","deviceAddress":"10.0.0.41","udid":"10.0.0.41:26101"}}
[HTTP] <-- POST /session 200 8010 ms - 386
[HTTP]
[HTTP] --> GET /session/7673576c-8c82-4f81-b735-257215bea654/source
[HTTP] {}
[TizenTVDriver@b819 (7673576c)] Driver proxy active, passing request on via HTTP proxy
[debug] [Chromedriver@c0fb (b9907c8b)] Matched '/session/7673576c-8c82-4f81-b735-257215bea654/source' to command name 'getPageSource'
[debug] [Chromedriver@c0fb (b9907c8b)] Proxying [GET /session/7673576c-8c82-4f81-b735-257215bea654/source] to [GET http://127.0.0.1:10081/session/b9907c8b4008cc73f36f9f76f86b8061/source] with no body
[debug] [Chromedriver@c0fb (b9907c8b)] Got response with status 200: {"sessionId":"b9907c8b4008cc73f36f9f76f86b8061","status":0,"value":"<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body><pre style=\"word-wrap: break-word; white-space: pre-wrap;\"></pre><iframe name=\"chromedriver dummy frame\" src=\"about:blank\"></iframe></body></html>"}
[Chromedriver@c0fb (b9907c8b)] Replacing sessionId b9907c8b4008cc73f36f9f76f86b8061 with 7673576c-8c82-4f81-b735-257215bea654
[HTTP] <-- GET /session/7673576c-8c82-4f81-b735-257215bea654/source 200 51 ms - 279

Expected behavior:
As you can see it looks like it is only opening the browser, is there a way to load the TV app in chrome. We can only do it manually. Below is the image after opening the debug address manually.

image

@jlipps
Copy link
Collaborator

jlipps commented Nov 18, 2022

it may be that version of chromedriver is too old to respect the debuggerAddress capability. try a newer version of chromedriver. i think 2.46 was the one that i found worked in testing.

@Chanak7
Copy link
Author

Chanak7 commented Nov 18, 2022

Our Tizen TV chrome version is 56.0.2924.0.

  1. When we try to use a compatible chromedriver version, like 2.29 or 2.30, it fails with the initial problem reported on the issue.

  2. And when we try to use a chromedriver newer than 2.30, like 2.46, it gives the following error:

Original error: Unable to automate Chrome version because it is not supported by this version of Chromedriver.
Chrome version on the device: Chrome/56.0.2924.0
Chromedriver supports Chrome version(s): >= 58.0.3029.0

@jlipps
Copy link
Collaborator

jlipps commented Nov 18, 2022

That TV may just be too old then. Any way to do an OS update?

@iprecali1
Copy link

Hi i have experienced same error and i would like to know if its possible to fix this

i already know were the problem is
its in the driver.js file

await this.#chromedriver.start({
'goog:chromeOptions': {
debuggerAddress,
},
});

this code should also account for older versions of chromedriver which dont support goog prefix for chromeOptions

there should be a possibility to check chromedriver version (which i dont know how to do) and depending on this version chromedriver should be started with or without goog prefix

goog prefix was introduced in chromdriver 2.31 but Tizen 4 runs on Chrome 56 which requires chromedriver 2.29 or older

Resolved issue 1786: Feature request: change chromeOptions to goog:chromeOptions [['Pri-3']]
https://chromedriver.storage.googleapis.com/2.31/notes.txt - release notes for chromdriver v2.31
https://stackoverflow.com/questions/63271454/googchromeoptions-vs-chromeoptions-in-protractor - here is explanation

@jlipps
Copy link
Collaborator

jlipps commented May 11, 2023

does it work if you change it to something like:

 await this.#chromedriver.start({ 
   'goog:chromeOptions': { 
     debuggerAddress, 
   },
   'chromeOptions': { 
     debuggerAddress, 
   }, 
 }); 

i.e., maybe we can just send both and chromedriver will pick up whatever is appropriate for its version?

@iprecali1
Copy link

iprecali1 commented May 12, 2023

Tested and having both object keys doesnt work properly for me at least

what about adding something like new capability

capability description
appium:preW3C Use this capability when using older versions of Chromedriver (< v2.31) that don't support W3C standard. With Chromedriver v2.31 there was a new feature introduced that changed Chrome-specific capabilities object key from chromeOptions to goog:chromeOptions to be compatible with W3C standard (Chromedriver v2.31 Release notes). We found out that Chromedriver v2.29, which is not compatible with W3C starndard, is required to run on Tizen 4 which has Chrome 56 as Web Engine. Defaults to false.

and then have something like

    if (preW3C) {
      log.info('Using pre W3C standard Chrome-specific capabilities object key!');
    }
    const chromeOptions = {
      [preW3C ? 'chromeOptions' : 'goog:chromeOptions']: {
        debuggerAddress,
      },
    };

@jlipps
Copy link
Collaborator

jlipps commented May 12, 2023

yeah I think something like this is great. can you apply the change yourself to ensure that it works, and then raise a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants