Way to dismiss anr dialogs?

459 views
Skip to first unread message

calebl...@gmail.com

unread,
Sep 18, 2016, 10:46:29 PM9/18/16
to Automate
I recently made a post on trying to find the id on a specific button, and I ended up coming back here with further depth on a more specific subject.

Is there a way to dismiss the "App not responding, would you like to close it?" dialog?
I tried the interact block set to loop every 15 and immediately dismiss system dialogs, but the anr dialog only goes away with a tap of the "ok", "report", and "wait" buttons. Is there a way to detect when an anr dialog pops up? If I can get a block that can do "if anr dialog present then do this", or something similar, that would work too. I will take ANYTHING I can get my hands on relating to the anr dialog, the id of one or more of the buttons, a way to detect if the anr dialog is present, or something that will force close the dialog, but I can't do "dismiss system dialogs" in the interact block because it doesn't dismiss the anr dialogs, and I can't do "record interaction" in the interact block either because 1: I have already tried and it doesn't record the interactions for the regular dialogs, which I'm not struggling with, and 2: It will likely do the same for the anr dialogs. And on top of that I'm no coder so I can't find a way to force an anr dialog to pop up(assuming you need to know how to be able to do such a thing). However, as a last resort, I could settle with  a way to force a anr dialog to pop up and I could work from there.

Any help appreciated.

Henrik "The Developer" Lindqvist

unread,
Sep 20, 2016, 3:00:18 PM9/20/16
to Automate, calebl...@gmail.com
Using the Interact block is the only option i can think of, there's no system broadcast for ANR.

To detect the dialog, try...

Proceed: When UI element appear
Action: Inspect
UI element class: android.widget.TextView or com.android.internal.widget.DialogTitle
UI element text: Application not responding (or whatever the title of the dilaog is)
UI element id: @+id/alertTitle or  @android:id/alertTitle

or...

UI element class: android.widget.TextView
UI element text: <the dialog message>
UI element id: @+id/message or @android:id/message


To dismiss the dialog, try...

Proceed: Immediately
Action: Close system dialogs

or...

Action: Click
UI element class: android.widget.Button
UI element text: OK
UI element id: @+id/button1 or @android:id/button1
Reply all
Reply to author
Forward
0 new messages