Hi,
Ranorex isn't identifying the enter button of the app i'm testing and when running the scripts i see the error the following error.
Injecting to another application requires INJECT_EVENTS permission
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 latest_solution.nextlogin.Ranorex.Core.Testing.ITestModule.Run() in c:\Users\reeee.re\Documents\Ranorex\RanorexStudio Projects\latest solution\latest solution\Login_again.cs:line 115at Ranorex.Core.Testing.TestModuleLeaf.RunInternal(DataContext parentDataContext, Int32 iteration, Int32 iterationCount, Boolean skipIteration)
application requires INJECT_EVENTS permission
Re: application requires INJECT_EVENTS permission
Hi,
Could you please tell us more about the tested app and what exactly you are trying to do? Ideally, post also the snapshot of the problematic element.
Also, I think you should see this post:
https://www.ranorex.com/forum/viewtopic ... NTS#p35252
Basically, if the element you are trying to access is a part of system process or another (non-instrumented) app, you can see this error. And there is unfortunately nothing you or Ranorex can do about this.
Could you please tell us more about the tested app and what exactly you are trying to do? Ideally, post also the snapshot of the problematic element.
Also, I think you should see this post:
https://www.ranorex.com/forum/viewtopic ... NTS#p35252
Basically, if the element you are trying to access is a part of system process or another (non-instrumented) app, you can see this error. And there is unfortunately nothing you or Ranorex can do about this.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: application requires INJECT_EVENTS permission
I have the same issue. I opened a case at Ranorex on February 2023, but still no fix.
I suppose it is an Android13 limitation, because using Android12 I didn't have the issue.
Basically any element of the instrumented app cannot be interacted cause of the following exception:
If I try to access to the device shell and try to use the command input tap x y, I can tap the wanted button. So I think it is not a instrumented app limitation...
I suppose it is an Android13 limitation, because using Android12 I didn't have the issue.
Basically any element of the instrumented app cannot be interacted cause of the following exception:
Code: Select all
Injecting input events requires the caller (or the source of the instrumentation, if any) to have the INJECT_EVENTS permission.
Show/Hide Stacktrace
in Ranorex.Plugin.Mobile.XmlRpc.XmlRpcProtocolChannel.Call(MethodCall mc, TimeSpan responseTimeout)in Ranorex.Plugin.Mobile.Device.Channels.AppLogicChannel.TouchChild(IElementWithId element, IChildElementWithId childElement, Boolean isLongTouch, TouchEvent evt)in Ranorex.Plugin.Mobile.RxIntegration.Elements.MobileWebFlavorElement.ClickDomElement(DomFlavorElement domElement, TouchEvent te)in Ranorex.Plugin.Mobile.RxIntegration.Elements.Web.DomFlavorElement.Touch(TouchEvent evt)in Ranorex.Touch.Tap(Element element, Int32 pointer, Location location, Duration touchDuration)in Ranorex.Adapter.Touch()in CommonCode.Custom.SetupTeardown.mMOT.mMOT_Android.Login_APK.Ranorex.Core.Testing.ITestModule.Run() in C:\Develop\Git\AUT-MonoMOT\MonoMOT\CommonCode\Custom\SetupTeardown\mMOT\mMOT_Android\Login_APK.cs:riga 158in Ranorex.Core.Testing.TestModuleLeaf.RunInternal(DataContext parentDataContext, Int32 iteration, Int32 iterationCount, Boolean skipIteration
-
- Posts: 15
- Joined: Wed Feb 08, 2023 10:47 am
Re: application requires INJECT_EVENTS permission
This issue is reoccurring on a mobile endpoint using Android 11 when attempting to Touch() on an object that was found by Ranorex.
- The apk was correctly instrumented using the Ranorex wizard.
- Keyboard action work just fine, a Touch action does not.
- This error only occurs roughly 80% of the time
Another forum post describing this issue from 2015!, unresolved.
Previous forum post describing this issue from 2019!, unresolved.
This forum post was made in 2020, it is now 2023 and this has yet to be resolved...
Am still attempting to provide a workaround
- The apk was correctly instrumented using the Ranorex wizard.
- Keyboard action work just fine, a Touch action does not.
- This error only occurs roughly 80% of the time
Another forum post describing this issue from 2015!, unresolved.
Previous forum post describing this issue from 2019!, unresolved.
This forum post was made in 2020, it is now 2023 and this has yet to be resolved...
Am still attempting to provide a workaround

Application Engineer 
The workaround experience, awaiting a reply

The workaround experience, awaiting a reply
-
- Posts: 15
- Joined: Wed Feb 08, 2023 10:47 am
Re: application requires INJECT_EVENTS permission
Would you kindly reply as to resolve this issue so we can continue supporting Ranorex-driven automated tests on mobile devices?odklizec wrote: ↑Wed Jun 24, 2020 7:39 amHi,
Could you please tell us more about the tested app and what exactly you are trying to do? Ideally, post also the snapshot of the problematic element.
Also, I think you should see this post:
https://www.ranorex.com/forum/viewtopic ... NTS#p35252
Basically, if the element you are trying to access is a part of system process or another (non-instrumented) app, you can see this error. And there is unfortunately nothing you or Ranorex can do about this.
It seems improbable that there is no way to fix this issue as no problems occurred before when we created several test suites containing test cases using another version of Android.
(Installing the application as a system app is not an option for our device, as suggested when googling this problem.)
Application Engineer 
The workaround experience, awaiting a reply

The workaround experience, awaiting a reply