Need help with recording script of the android device

Ask general questions here.
tutejshy
Posts: 8
Joined: Thu Sep 12, 2013 11:26 pm

Need help with recording script of the android device

Post by tutejshy » Fri Sep 13, 2013 12:10 am

HI. I'm using Ranorex 30 days trial.
Trying to Record my first script for Android and getting error: Instrumentation failed. Anyone can help me what i'm doing wrong?


My Steps:
- Invoke Ranorex Recorder (64bit)
-Click Record
-Click Deploy
-Select device (Galaxy S4)
-Browse for APK file (from Desktop)
-Click Next (it starts instrumenting)

Getting Error: Instrumentation occurred.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Need help with recording script of the android device

Post by Support Team » Fri Sep 13, 2013 4:27 pm

Hello,

Is the JRE 1.6 installed on your machine?
Please read the section "Android Testing" in our user guide.
Maybe you have to instrument the APK file manually.

Regards,
Bernhard
.
Image

tutejshy
Posts: 8
Joined: Thu Sep 12, 2013 11:26 pm

Re: Need help with recording script of the android device

Post by tutejshy » Fri Sep 13, 2013 6:05 pm

JRE 1.6 is installed..
How do I instrument APK file manually? Also, do I have to put it in the same derictory where Ranorex is?

tutejshy
Posts: 8
Joined: Thu Sep 12, 2013 11:26 pm

Re: Need help with recording script of the android device

Post by tutejshy » Fri Sep 13, 2013 9:45 pm

These are the errors I'm getting

System.NullReferenceException: Object reference not set to an instance of an object.
at Ranorex.Plugin.Mobile.PlatformComponents.DeviceBridges.ApkFileInstrumenter.ResolveInheritanceDependencies(DecompileInfo dcInfo, IPathService pathService)
at Ranorex.Plugin.Mobile.PlatformComponents.DeviceBridges.ApkFileInstrumenter.InstrumentCode(DecompileInfo dcInfo, Int32 port, IPathService pathService)
at Ranorex.Plugin.Mobile.PlatformComponents.DeviceBridges.BackgroundWorkerSupported.ExecuteBgwCode[TArg0,TArg1,TArg2](BgwDelegate`3 methodDelegate, Int32 doneProgress, String progressText, TArg0 arg0, TArg1 arg1, TArg2 arg2, BackgroundWorker bgw)
at Ranorex.Plugin.Mobile.PlatformComponents.DeviceBridges.ApkFileInstrumenter.Instrument(String apkFilePath, Int32 port, BackgroundWorker bgw)
at Ranorex.Controls.Instrumentation.Workers.AndroidWorker.Run()
at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)

tutejshy
Posts: 8
Joined: Thu Sep 12, 2013 11:26 pm

Re: Need help with recording script of the android device

Post by tutejshy » Sun Sep 15, 2013 2:38 am

Also tried instrument KeePassDroid, seems like it was instrumented but still no luck with lunching it. Any ideas what went wrong? I kinda need to present Automated solution to my manager next week, if we'll decide to go with Ranorex, I need to make it work, so far it takes more time then it should and no help from support.

Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Need help with recording script of the android device

Post by Support Team » Mon Sep 16, 2013 7:45 am

Hello,

In order to instrument the APK manually please read the section "Instrumentation with Source Code" in our user guide.
Please let me know if you get the error message after instrumenting your APK via user code as well.
Could you please give me more information about your device? Which Android version are you using? Is your device connected via WIFI or via USB?

Regards,
Bernhard
.
Image

tutejshy
Posts: 8
Joined: Thu Sep 12, 2013 11:26 pm

Re: Need help with recording script of the android device

Post by tutejshy » Mon Sep 16, 2013 6:30 pm

Hello Bernhard.
I'm using Samsung Galaxy S4 for now. Connected via USB. Also was wondering which Test Solution I should use? C# or CBNet?

As of now I don't have access to the source code... I get new builds over Jenkins which installed in every device. So i tried to copy it to desktop then using Ranorex instrument it on device. Dose it work if I have only apk file without access to the source code?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Need help with recording script of the android device

Post by Support Team » Tue Sep 17, 2013 1:23 pm

Hello,
C# or VBNet?
It depends on which programming language do you prefer.
Dose it work if I have only apk file without access to the source code?
Unfortunately it is not possible to instrument the apk with source code without having the source code.
Is it possible to get the *.apk file in order to analyze the issue in more detail?
Thank you!

Regards,
Bernhard
.
Image

tutejshy
Posts: 8
Joined: Thu Sep 12, 2013 11:26 pm

Re: Need help with recording script of the android device

Post by tutejshy » Tue Sep 17, 2013 4:54 pm

Just to clarify...by source code you mean I need to have the same environment build as developers?or just have it stored on my machine...?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Need help with recording script of the android device

Post by Support Team » Wed Sep 18, 2013 12:24 pm

Hello,

Yes, you have to add the source to the project and compile it after doing this. Therefore it is not enough just to have the source code stored on your machine.

Regards,
Bernhard
.
Image

tutejshy
Posts: 8
Joined: Thu Sep 12, 2013 11:26 pm

Re: Need help with recording script of the android device

Post by tutejshy » Tue Sep 24, 2013 9:38 pm

So, after installing Android dev enviroment (Android studio) and copying full project source code I tried to instrument it manually. Entered Java code to all Activities (which is damn a lot of them), and adding permission along with Ranorex to Manifest.xml file, additionally Ranorex jar file was attached to project library.

STILL GETTING THE SAME ERRORS... not able to link Ranorex and mobile device....
WHAT AM"I DOING WRONG NOW? ANY IDEAS?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Need help with recording script of the android device

Post by Support Team » Fri Sep 27, 2013 9:19 am

Hello,

At the moment we don't know what the issue is. Would it be possible to get your APK file in order to analyze the issue in more detail?
Please let me know if this is possible.
Thank you!

Regards,
Bernhard
.
Image

tutejshy
Posts: 8
Joined: Thu Sep 12, 2013 11:26 pm

Re: Need help with recording script of the android device

Post by tutejshy » Thu Oct 03, 2013 10:02 pm

Hi Bernhard.
How can I sent you an apk file? I see error msg: the extension apk is not allowed...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Need help with recording script of the android device

Post by Support Team » Mon Oct 07, 2013 9:49 pm

Hello,

I sent the access information to you via email.

Regards,
Bernahrd
.
Image

bnharsha
Posts: 4
Joined: Fri Oct 11, 2013 12:58 pm

Re: Need help with recording script of the android device

Post by bnharsha » Fri Oct 11, 2013 2:33 pm

Hello Bernahrd

I am also facing the issue with instrumentation. Please let me know where can I share the APK file for debugging. I need to share the evaluation results to one of my customers

Regards, Harsha B-N