Page 1 of 1

INJECT_EVENTS permission intermittently

Posted: Tue May 24, 2016 8:49 am
by thilina
when executing android tests, I get this error intermittently.

can't say when it happens, some times this get success, sometimes fails

Injecting to another application requires INJECT_EVENTS permission

Code: Select all

at Ranorex.Plugin.Mobile.XmlRpc.XmlRpcProtocolChannel.Call(MethodCall mc, TimeSpan responseTimeout) at Ranorex.Plugin.Mobile.Device.Channels.AppLogicChannel.Touch(String loc, Int32 elementIdentifier, Boolean isLongClick, Int32 duration) at Ranorex.Plugin.Mobile.Device.Channels.AppLogicChannel.Touch(IElementWithId element, TouchEvent evt) at Ranorex.Plugin.Mobile.RxIntegration.Elements.MobileFlavorElement.Touch(TouchEvent evt) at Ranorex.Touch.Tap(Element element, Int32 pointer, Location location, Duration touchDuration) at Ranorex.Adapter.Touch() at AndroidTests.PNL.Activities.Recording_Modules.Summary.Summary_Next.Ranorex.Core.Testing.ITestModule.Run() in f:\Ranorex\ranorex\AutomationTestSuite\AndroidTests\PNL\Activities\Recording Modules\Summary\Summary_Next.cs:line 86 at Ranorex.Core.Testing.TestSuiteModule.RunInternal(DataContext parentDataContext

Re: INJECT_EVENTS permission intermittently

Posted: Tue May 24, 2016 9:05 am
by odklizec
Hi,

Could you please tell us, what version of Ranorex do you use? If not the latest 6.0, try it then (and of course, corresponding Android app
http://www.ranorex.com/support/user-gui ... chive.html).

Re: INJECT_EVENTS permission intermittently

Posted: Mon Jun 13, 2016 8:21 am
by thilina
I get the same error with

Ranorex studio 6 and Ranorex service 1.8.6

Re: INJECT_EVENTS permission intermittently

Posted: Tue Jun 14, 2016 8:04 am
by zivshapirawork
while investigating, try to catch the specific exception and do a retry loop (maybe 3 times) on the action.
Since this does not always happen, then the action might succeed.

Re: INJECT_EVENTS permission intermittently

Posted: Tue Jun 14, 2016 8:12 am
by lucian.teodorescu
Hi,

I am also facing the same issue for some long time.
Most of the times this happens when some action is not naturally possible e.g.: touch on some (not all) invisible element.
I use genymotion virtual device (VD) to test our android apps. Real devices connected through USB are way too slow because of the ADB. VD is connected via WiFi.
Sometimes, during lengthy tests, VD becomes slow and the actions are delayed so long that INJECT_EVENTS error occurs.

To overcame this issue I restart the VD from time to time. Actually I close it, wait for the process to stop and memory to be cleared and then start it again. All these steps are performed automatically using adb commands.

Hope this helps.

Re: INJECT_EVENTS permission intermittently

Posted: Thu May 03, 2018 5:06 pm
by asishr
Anybody still having this issue on Ranorex 8.1?The element I am looking for is also visible & I use a real device so suggested work around didn`t worked for me. I have device connected with USB :oops:

Re: INJECT_EVENTS permission intermittently

Posted: Thu Nov 23, 2023 9:16 am
by Julie.Toussaint