dlenroc / appium-roku-driver

WebDriver for testing channels / screensavers on roku devices
MIT License
10 stars 0 forks source link

[ODC] - Get Page Source - The driver is failing with a 500 fetch error #100

Open semeguze opened 2 weeks ago

semeguze commented 2 weeks ago

Issue Summary

I’m encountering an internal error when running a command with the RokuDriver and the ODC context. The error message indicates a TypeError: fetch failed.

I'm using the most updated Node + Appium + Appium inspector versions.

Context and Additional Information

We are trying to use the ODC context instead of ECP because our team is attempting to add custom arguments to the DOM file, such as the automationID. However, we are not able to view the automationID argument while reading the DOM file with the default configuration.

Capabilities used:

{
  "platformName": "roku",
  "appium:automationName": "roku",
  "appium:app": "/Users/sebastian.mesa/Downloads/redacted.zip",
  "appium:ip": "192.168.2.125",
  "appium:password": "rokupass",
  "appium:context": "ODC"
}

Steps to Reproduce

The session is starting using the Appium Inspector, and the App is installed in my Roku device, but the page source it's not loading:

image

What did I already try?

I already tried:

System info

echo "macOS Version:" && sw_vers && echo "" && echo "Node.js Version:" && node -v && echo "" && echo "npm Version:" && npm -v && echo "" && (command -v nvm > /dev/null 2>&1 && echo "nvm Version:" && nvm --version && echo "" || true) && (command -v appium > /dev/null 2>&1 && echo "Appium Version:" && appium -v && echo "" || true) && echo "Global npm Packages:" && npm list -g --depth=0 && echo "" && (command -v java > /dev/null 2>&1 && echo "Java Version:" && java -version && echo "" || true) && (command -v python > /dev/null 2>&1 && echo "Python Version:" && python --version && echo "" || true) && (command -v ruby > /dev/null 2>&1 && echo "Ruby Version:" && ruby -v && echo "" || true)
macOS Version:
ProductName:        macOS
ProductVersion:     14.5
BuildVersion:       23F79

Node.js Version:
v22.3.0

npm Version:
10.8.1

nvm Version:
0.34.0

Appium Version:
2.10.3

Global npm Packages:
/Users/sebastian.mesa/.nvm/versions/node/v22.3.0/lib
├── appium-doctor@1.16.2
├── appium@2.10.3
├── corepack@0.28.2
├── node-fetch@3.3.2
├── npm@10.8.1
└── run-script-os@1.1.6

Java Version:
openjdk version "11.0.17" 2022-10-18 LTS
OpenJDK Runtime Environment Corretto-11.0.17.8.1 (build 11.0.17+8-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.17.8.1 (build 11.0.17+8-LTS, mixed mode)

Ruby Version:
ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]

Logs

These are the logs from the appium server:

node -v
npm -v
appium
v22.3.0
10.8.1
[Appium] Welcome to Appium v2.10.3 (REV 3d9c31d94488884e74ae1ba0d46bc6607bc74667)
[Appium] The autodetected Appium home path: /Users/sebastian.mesa/.appium/node_modules/@dlenroc/appium-roku-driver
[Appium] Attempting to load driver roku...
[Appium] Requiring driver at /Users/sebastian.mesa/.appium/node_modules/@dlenroc/appium-roku-driver/dist/index.js
[Appium] RokuDriver has been successfully loaded in 0.419s
[Appium] Appium REST http interface listener started on http://0.0.0.0:4723
[Appium] You can provide the following URLs in your client code to connect to this server:
    http://127.0.0.1:4723/ (only accessible from the same host)
    http://192.168.2.245:4723/
[Appium] Available drivers:
[Appium]   - roku@0.12.0 (automationName 'roku')
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
[HTTP] --> POST /session {"capabilities":{"alwaysMatch":{"platformName":"roku","appium:automationName":"roku","appium:app":"/Users/sebastian.mesa/Downloads/redacted.zip","appium:ip":"192.168.2.125","appium:password":"rokupass","appium:context":"ODC","appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]},"desiredCapabilities":{"platformName":"roku","appium:automationName":"roku","appium:app":"/Users/sebastian.mesa/Downloads/redacted.zip","appium:ip":"192.168.2.125","appium:password":"rokupass","appium:context":"ODC","appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true}}
[AppiumDriver@1c55] Calling AppiumDriver.createSession() with args: [{"platformName":"roku","appium:automationName":"roku","appium:app":"/Users/sebastian.mesa/Downloads/redacted.zip","appium:ip":"192.168.2.125","appium:password":"rokupass","appium:context":"ODC","appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},null,{"alwaysMatch":{"platformName":"roku","appium:automationName":"roku","appium:app":"/Users/sebastian.mesa/Downloads/redacted.zip","appium:ip":"192.168.2.125","appium:password":"rokupass","appium:context":"ODC","appium:newCommandTimeout":3600,"appium:connectHardwareKeyboard":true},"firstMatch":[{}]}]
[AppiumDriver@1c55] Event 'newSessionRequested' logged at 1718987480638 (11:31:20 GMT-0500 (Colombia Standard Time))
[Appium] Attempting to find matching driver for automationName 'roku' and platformName 'roku'
[Appium] The 'roku' driver was installed and matched caps.
[Appium] Will require it at /Users/sebastian.mesa/.appium/node_modules/@dlenroc/appium-roku-driver
[Appium] Requiring driver at /Users/sebastian.mesa/.appium/node_modules/@dlenroc/appium-roku-driver/dist/index.js
[AppiumDriver@1c55] Appium v2.10.3 creating new RokuDriver (v0.12.0) session
[AppiumDriver@1c55] Checking BaseDriver versions for Appium and RokuDriver
[AppiumDriver@1c55] Appium's BaseDriver version is 9.10.3
[AppiumDriver@1c55] RokuDriver's BaseDriver version is 9.10.3
[RokuDriver@355a] undefined
[RokuDriver@355a] Creating session with W3C capabilities: {
  "alwaysMatch": {
    "platformName": "roku",
    "appium:automationName": "roku",
    "appium:app": "/Users/sebastian.mesa/Downloads/redacted.zip",
    "appium:ip": "192.168.2.125",
    "appium:password": "rokupass",
    "appium:context": "ODC",
    "appium:newCommandTimeout": 3600,
    "appium:connectHardwareKeyboard": true
  },
  "firstMatch": [
    {}
  ]
}
[RokuDriver@355a] The following provided capabilities were not recognized by this driver:
[RokuDriver@355a]   connectHardwareKeyboard
[RokuDriver@355a] Session created with session id: 404ef6d4-4bdc-4e7f-8fe5-541aad23a532
[BaseDriver] Using local app '/Users/sebastian.mesa/Downloads/redacted.zip'
[RokuDriver@355a] Channel is already installed
[AppiumDriver@1c55] New RokuDriver session created successfully, session 404ef6d4-4bdc-4e7f-8fe5-541aad23a532 added to master session list
[AppiumDriver@1c55] Event 'newSessionStarted' logged at 1718987483732 (11:31:23 GMT-0500 (Colombia Standard Time))
[RokuDriver@355a] Cached the protocol value 'W3C' for the new session 404ef6d4-4bdc-4e7f-8fe5-541aad23a532
[RokuDriver@355a] Responding to client with driver.createSession() result: {"capabilities":{"platformName":"roku","automationName":"roku","app":"/Users/sebastian.mesa/Downloads/redacted.zip","ip":"192.168.2.125","password":"rokupass","context":"ODC","newCommandTimeout":3600,"connectHardwareKeyboard":true}}
[HTTP] <-- POST /session 200 3129 ms - 432
[404ef6d4][HTTP] --> GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/screenshot {}
[404ef6d4][RokuDriver@355a] Calling AppiumDriver.getScreenshot() with args: ["404ef6d4-4bdc-4e7f-8fe5-541aad23a532"]
[404ef6d4][RokuDriver@355a] Responding to client with driver.getScreenshot() result: "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCALQBQADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD5/ooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAC...
[404ef6d4][HTTP] <-- GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/screenshot 200 1136 ms - 28480
[404ef6d4][HTTP] --> GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/window/rect {}
[404ef6d4][RokuDriver@355a] Calling AppiumDriver.getWindowRect() with args: ["404ef6d4-4bdc-4e7f-8fe5-541aad23a532"]
[404ef6d4][RokuDriver@355a] Encountered internal error running command: NotYetImplementedError: Method has not yet been implemented
    at RokuDriver.executeCommand (/Users/sebastian.mesa/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@appium/base-driver/lib/basedriver/driver.ts:100:13)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
[404ef6d4][HTTP] <-- GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/window/rect 405 21 ms - 406
[404ef6d4][HTTP] --> GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/source {}
[404ef6d4][RokuDriver@355a] Calling AppiumDriver.getPageSource() with args: ["404ef6d4-4bdc-4e7f-8fe5-541aad23a532"]
[404ef6d4][RokuDriver@355a] Encountered internal error running command: TypeError: fetch failed
    at node:internal/deps/undici/undici:13193:13
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at execute (file:///Users/sebastian.mesa/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@dlenroc/roku-odc/src/internal/execute.ts:45:20)
    at getAppUI (file:///Users/sebastian.mesa/.appium/node_modules/@dlenroc/appium-roku-driver/node_modules/@dlenroc/roku-odc/src/commands/getAppUI.ts:10:20)
[404ef6d4][HTTP] <-- GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/source 500 23 ms - 600
[404ef6d4][HTTP] --> GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts {}
[404ef6d4][RokuDriver@355a] Calling AppiumDriver.getTimeouts() with args: ["404ef6d4-4bdc-4e7f-8fe5-541aad23a532"]
[404ef6d4][RokuDriver@355a] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[404ef6d4][HTTP] <-- GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts 200 7 ms - 42
[404ef6d4][HTTP] --> GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts {}
[404ef6d4][RokuDriver@355a] Calling AppiumDriver.getTimeouts() with args: ["404ef6d4-4bdc-4e7f-8fe5-541aad23a532"]
[404ef6d4][RokuDriver@355a] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[404ef6d4][HTTP] <-- GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts 304 3 ms - -
[404ef6d4][HTTP] --> GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts {}
[404ef6d4][RokuDriver@355a] Calling AppiumDriver.getTimeouts() with args: ["404ef6d4-4bdc-4e7f-8fe5-541aad23a532"]
[404ef6d4][RokuDriver@355a] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[404ef6d4][HTTP] <-- GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts 304 6 ms - -
[404ef6d4][HTTP] --> GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts {}
[404ef6d4][RokuDriver@355a] Calling AppiumDriver.getTimeouts() with args: ["404ef6d4-4bdc-4e7f-8fe5-541aad23a532"]
[404ef6d4][RokuDriver@355a] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[404ef6d4][HTTP] <-- GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts 304 26 ms - -
[404ef6d4][HTTP] --> GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts {}
[404ef6d4][RokuDriver@355a] Calling AppiumDriver.getTimeouts() with args: ["404ef6d4-4bdc-4e7f-8fe5-541aad23a532"]
[404ef6d4][RokuDriver@355a] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[404ef6d4][HTTP] <-- GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts 304 6 ms - -
[404ef6d4][HTTP] --> GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts {}
[404ef6d4][RokuDriver@355a] Calling AppiumDriver.getTimeouts() with args: ["404ef6d4-4bdc-4e7f-8fe5-541aad23a532"]
[404ef6d4][RokuDriver@355a] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[404ef6d4][HTTP] <-- GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts 304 13 ms - -
[404ef6d4][HTTP] --> GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts {}
[404ef6d4][RokuDriver@355a] Calling AppiumDriver.getTimeouts() with args: ["404ef6d4-4bdc-4e7f-8fe5-541aad23a532"]
[404ef6d4][RokuDriver@355a] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[404ef6d4][HTTP] <-- GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts 304 6 ms - -
[404ef6d4][HTTP] --> GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts {}
[404ef6d4][RokuDriver@355a] Calling AppiumDriver.getTimeouts() with args: ["404ef6d4-4bdc-4e7f-8fe5-541aad23a532"]
[404ef6d4][RokuDriver@355a] Responding to client with driver.getTimeouts() result: {"command":3600000,"implicit":0}
[404ef6d4][HTTP] <-- GET /session/404ef6d4-4bdc-4e7f-8fe5-541aad23a532/timeouts 304 6 ms - -

Any help would be really appreciated!! Thanks! 🚀

dlenroc commented 1 week ago

Hi @semeguze, could you please confirm if the ODC server injected into your application by the driver is functioning correctly?