headspinio / appium-tizen-tv-driver

A Samsung Tizen TV driver for Appium
Apache License 2.0
10 stars 2 forks source link

Not able to take screenshot on Tizen TV #583

Open Jiyvn opened 4 months ago

Jiyvn commented 4 months ago

Please refer to https://github.com/appium/appium/issues/19905

code

BaseOptions options = new BaseOptions()
        .amend("appium:deviceName", "Tizen5.5 2020")
        .amend("platformName", "TizenTV")
        .amend("appium:automationName", "TizenTV")
        .amend("appium:udid", "192.168.10.184:26101")
        .amend("appium:deviceAddress", "192.168.10.184:26101")
        .amend("appium:noReset", false)
        .amend("appium:fullContextList", true)
        .amend("appium:app", "/Users/$USER/aviu/apps/Viu_dev.wgt")
        .amend("appium:chromedriverExecutableDir", "/Users/$USER/aviu/apps/tv/chromedriver/")
        .amend("appium:rcMode", "remote")
        .amend("appium:rcToken", "15615414")
        .amend("appium:appPackage", "TXSXgdzhCp");

driver = new AppiumDriver(new URL("http://127.0.0.1:4723"), options);
// sleep for a while
...
byte[] bytes = ((TakesScreenshot) driver).getScreenshotAs(OutputType.BYTES);

error

Mar 18, 2024 6:38:31 PM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '408' -> incorrect JSON status mapping for 'timeout' (500 expected) org.openqa.selenium.TimeoutException: timeout: Timed out receiving message from renderer: 9.999 (Session info: chrome=69.0.3497.128) (Driver info: chromedriver=2.44.609545 (c2f88692e98ce7233d2df7c724465ecacfe74df5),platform=Mac OS X 10.16.0 x86_64) Build info: version: '4.18.1', revision: 'b1d3319b48' System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.0', java.version: '17.0.7' Driver info: io.appium.javaclient.AppiumDriver Command: [16a06b95-908c-4ae5-a9fe-c1eb2aa673fb, screenshot {}] Capabilities {appium:app: /Users/$USER/aviu/apps/Viu..., appium:appLaunchCooldown: 3000, appium:appPackage: TXSXgdzhCp, appium:automationName: TizenTV, appium:chromedriverExecutableDir: /Users/$USER/aviu/apps/tv/c..., appium:deviceAddress: 192.168.10.184:26101, appium:deviceName: Tizen5.5 2020, appium:fullContextList: true, appium:noReset: false, appium:rcMode: remote, appium:rcToken: 15615414, appium:udid: 192.168.10.184:26101, platformName: TizenTV} Session ID: 16a06b95-908c-4ae5-a9fe-c1eb2aa673fb at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167) at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:138) at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:190) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:237) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:519) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:592) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:307) at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java:322) at io.appium.java_client.AppiumDriver.getScreenshotAs(AppiumDriver.java:316) at steps.tizenTVDemoStepDef.afterScenario(tizenTVDemoStepDef.java:59)

logs

https://gist.github.com/Jiyvn/755599c542a3475eaf399473161b3a1c

KazuCocoa commented 4 months ago

It looks like the error came from chromedriver. Then. possibly nothing could do as this driver, or try out remote mode...?

Jiyvn commented 4 months ago

@KazuCocoa I did use remote mode .amend("appium:rcMode", "remote")

KazuCocoa commented 4 months ago

then, I have no idea about that. Basically, the error came from the render, which is a TV device in this case. I wondered if you could try out older chromedriver versions explicitly like 2.36 etc.

(Session info: chrome=69.0.3497.128) (Driver info: chromedriver=2.44.609545 (c2f88692e98ce7233d2df7c724465ecacfe74df5),platform=Mac OS X 10.16.0 x86_64)

Such older versions do not require a specific chrome version. Some might work

Jiyvn commented 4 months ago

@KazuCocoa I actually tried chromedriver 2.36, but it is worse, even the page source is not available. But I am using MacOS 14 with m1 series, not sure if it is related

KazuCocoa commented 4 months ago

Perhaps the error itself came from Chrome engine on the TV device. macOS might not be related, although this is chrome or chromedriver related so this driver itself might not help for the error.