Can we automate Fire TV using Appium

My company is asking me to automate Fire TV . If it is not possible on Appium then use espresso.

Please help me out of this.

What have you tried so far?

Hi Afwang,

I am able to launch the application from appium.
only one issue : UIAUTOMATOR is not working on Fire OS version 5.0.5.1(537175520)

Regards
Jitu Kumar Patel

1 Like

Can you paste a copy of your Appium logs? You can paste a copy of your logs with Github Gist or Pastebin.

Can you also post the Android API level of your device? Connect your TV with adb, and then run adb shell getprop ro.build.version.sdk. Uiautomator should be available for devices running API 17 and newer; older devices have to fall back to using Selendroid.

It’s also possible that Amazon might have heavily altered their version of Android and stripped out Uiautomator. I hope they don’t do that, though, because that’s just a waste of resources for no practical benefit.

C:\Users\jitu.patel>adb shell getprop ro.build.version.sdk
22

The logs look like you’re successfully automating the app, but your test code might not be doing what you want it to do?

Can you paste an excerpt of your test code and explain what you want your code to do? I’m guessing you’re looking for some text called “Live TV”, but that text was not found.

I am able automate the device.

To get the resource id of the elements we are using UIAUTOMATOR which is present inside tools folder of sdk.

UIAUTOMATOR is not able to take the screenshot.

So i am taking the page source and taking the resource id

I’m still not sure what you’re trying to do exactly, but if you want to take a screenshot, you can use adb and your device’s shell to help you grab a screenshot: http://developer.android.com/tools/help/shell.html#screencap However, since you’re using Appium, you also have the option to take a screenshot using the getScreenshotAs method.

It also sounds like you’re trying to retrieve a copy of the XML page source as a separate problem. You can use uiautomator’s (accessed through the device’s shell) dump subcommand to get an output of the UI in XML representation, but you have a better option through Appium by using the getPageSource method.

Hi afwang,

Please find the screenshot.

Problem: I need to fetch the fire TV UI on the UIAUTOMATOR screen but it is giving error: Error taking device screenshot : null

Regards
Jitu

1 Like

For that, I’m not too sure about. Try checking the logcat logs to see if they provide any hint to what’s going on when you take a UI snapshot. Alternatively, you can also try using adb shell screencap to try manually retrieving a screenshot.

Its working fine with me now I am able to launch the UI automator

@Jitu1888 : HI Jitu. Were you successfully able to automate the fire tv app. If so can you please share the steps you followed and challenges you faced. Thanks!

@Jitu1888 Immediate help would be appreciated.

In some OS version uiautomator was not working. Its similar to Android Phone Automation

Hi I can help you out .Currently I am working on Fire TV only

Can you guide me how to resolve “uiautomator” issue on Amazon fire stick?

Hi

Did you automate using Appium? Is it the same way as Appium is used for mobile automation?

I was able to do the firestick automation of an app successfully. If you want to know the steps please let me know.

Would be great if you can post the steps @jaym