I am currently working on automatiion for Kepler device and facing some issues trying to inspect UI.
I am able to connect to devcie using vda. Also it is possible for me to execute automation test cases using appium + wdio9.
But when I am trying to connect Kepler device to Appium Inspector it creates session but there is no UI screenshot which makes difficult to find locators which I can use in creatiion of new test cases and it slows me down in developing.
ENV:
kepler --version
0.20.3719
appium --version
2.19.0
appium driver: kepler@3.19.0 (automationName ‘automation-toolkit/JSON-RPC’)
Here is what it looks like when connected in Appium Inspector:
Thank you for your question about using Appium Inspector with Kepler devices. I understand you’re able to connect successfully but aren’t seeing UI screenshots, which makes element inspection challenging.
Workaround Available:
While we investigate this issue, you can use Vega’s built-in Developer Menu for UI inspection:
Set up port forwarding:
# For Fire TV Stick:
vda reverse tcp:8081 tcp:8081 && vda reverse tcp:8097 tcp:8097
# For Vega Virtual Device:
kepler device start-port-forwarding --device <DEVICE_NAME> -p 8081 --forward false
Start your Metro bundler: npm start
In the Metro terminal, press d to open the developer menu, then select “Show Element Inspector”
This will provide visual UI inspection directly on your device with element properties and hierarchy, allowing you to identify locators for your test automation.
Hello @amen ,
Thanks for response.
I will try suggested method. Thank you.
Meanwhile here is a part of appium logs when I am tryig to get page source in Apium inspector:
[df84bf97][HTTP] --> GET /session/df84bf97-2565-40a1-91cd-faaa3149a73c/screenshot {}
[df84bf97][KeplerDriver@1ebc] Calling AppiumDriver.getScreenshot() with args: ["df84bf97-2565-40a1-91cd-faaa3149a73c"]
Running /executeScript with script=getScreenshot, args=[ 'df84bf97-2565-40a1-91cd-faaa3149a73c', [length]: 1 ]
Sending jsonRPC POST http://127.0.0.1:15240/jsonrpc id=0, method=takeScreenshot, params object={}
received jsonrpc response in 53ms (http 200 OK): {"error":{"code":-32603,"data":null,"message":"INTERNAL_ERROR: : Failed to take screenshot. Reason: Screenshot error: Buffer is null"},"id":"0","jsonrpc":"2.0"}
[df84bf97][KeplerDriver@1ebc] Responding to client with driver.getScreenshot() result: null
[df84bf97][HTTP] <-- GET /session/df84bf97-2565-40a1-91cd-faaa3149a73c/screenshot 304 54 ms - -
[df84bf97][HTTP] --> GET /session/df84bf97-2565-40a1-91cd-faaa3149a73c/window/rect {}
[df84bf97][KeplerDriver@1ebc] Calling AppiumDriver.getWindowRect() with args: ["df84bf97-2565-40a1-91cd-faaa3149a73c"]
Running /executeScript with script=getWindowRect, args=[ 'df84bf97-2565-40a1-91cd-faaa3149a73c', [length]: 1 ]
Sending jsonRPC POST http://127.0.0.1:15240/jsonrpc id=0, method=getWindowRect, params object={}
received jsonrpc response in 5ms (http 200 OK): {"id":"0","jsonrpc":"2.0","result":{"height":1080,"width":1920,"x":0,"y":0}}
[df84bf97][KeplerDriver@1ebc] Responding to client with driver.getWindowRect() result: {"x":0,"y":0,"width":1920,"height":1080}
[df84bf97][HTTP] <-- GET /session/df84bf97-2565-40a1-91cd-faaa3149a73c/window/rect 304 5 ms - -
[df84bf97][HTTP] --> GET /session/df84bf97-2565-40a1-91cd-faaa3149a73c/source {}
[df84bf97][KeplerDriver@1ebc] Calling AppiumDriver.getPageSource() with args: ["df84bf97-2565-40a1-91cd-faaa3149a73c"]
Running /executeScript with script=getPageSource, args=[ 'df84bf97-2565-40a1-91cd-faaa3149a73c', [length]: 1 ]
Sending jsonRPC POST http://127.0.0.1:15240/jsonrpc id=0, method=getPageSource, params object={}
received jsonrpc response in 202ms
BTW while running automation we are getting excat the same error geting screenshot:
Sending jsonRPC POST http://127.0.0.1:15240/jsonrpc id=0, method=takeScreenshot, params object={}
received jsonrpc response in 53ms (http 200 OK): {"error":{"code":-32603,"data":null,"message":"INTERNAL_ERROR: : Failed to take screenshot. Reason: Screenshot error: Buffer is null"},"id":"0","jsonrpc":"2.0"}
Hello @Hryhorii_Solonynka
Are you using a physical screen/monitor or a video capture card?
The screenshot has some problem with video capture card.
We recommand you to use a physical screen/monitor for the testing.
Hello @Wenguang_Hu ,
Yes, I am using capture card but not direclty with Kepler device.
Device is connected to HDMI 4X1 Quad Multi-viewer to split the screen as I am using some more devices for streaming (Firetv, AndroidTV, AppleTV) and then this multi viewer device is connected to capture card to get video in OBS studio.
Trying to use kepler connected directly to monitor solves the issue with Appium Inspector.
Thanks a lot for pointing me to the root cause of the issue.