0

I would like to improve the performance of my app by the use of macrobenchmarks. Since my app is based on TV devices, user jounrneys will largely include using keyevents on a remote control.

What I would like to know is how can I emulate keypresses (both tap and hold types) while writing a test inside profileblock? Something like press Dpad DOWN, hold Dpad UP, etc.

Rahul Rawat
  • 103
  • 6

1 Answers1

0

You can use UiAutomator's pressDPad*() methods or pressKeyCode(). Check reference for options.

In profileBlock you can access UiDevice with the device property.

Check JetStream TV sample for inspiration

mlykotom
  • 4,850
  • 1
  • 22
  • 27