This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 4
Sep 2018

Banking apps and such tend to use FLAG_SECURE for safety reasons, so that the screen can not be captured or recorded. In such cases we are not able take Screen dump via UiAutomator viewer. How to see identify the element in such a cases. How to appium automate such apps ?

  • created

    Sep '18
  • last reply

    Oct '18
  • 3

    replies

  • 372

    views

  • 4

    users

I would guess they make a debug build that has this flag removed/turned off.

If there isn’t an option to disable the security (as I have in our checkout flows), it can be painful. Luckily you can still get the screen source. So it’s a bit more manual. You can still use the UiAutomatorView I believe, it’s just all black, and then just click where you know the element is. Or just start a test that all it does it get you to the screen and take a source dump, and look through that for the items you need. Annoying, but works.

FLAG_SECURE only blocks capture screenshot, you can not use UIAutomatorViewer or Appium inspector because they both takes screen snapshot. However you should be able to get element hierarchy by driver.getPageSource() in debug mode. It returns XML which you can use for building locator.