instrumentation fail on time in code ignores limit
Posted: Mon Mar 23, 2015 1:25 pm
I tried to instrument an apk file using Ranorex 5.3.0 and RC4 apktool.
I received the following error that the instrumentation did not complete in the default time (2 min)
although I had coded 20 minutes, running the recording still failed after 2 minutes (below) and the error is the same as from the Ranorex IDE instrumentation option.
has anyone encountered the issue of instrumentation code ignoring the allocated duration?
I received the following error that the instrumentation did not complete in the default time (2 min)
I wrote instrumentation code in a recording, so that I can add more time to the default.System.TimeoutException: Process did not finish within the specified timeout of '00:02:00'.
at Ranorex.Core.ProcessRunner.RunShortProcess(Boolean showWindow, TimeSpan timeout, IList`1 appendToPath)
at Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.ApkFileInstrumenter.CompileApkFile(String sourceApkFilePath, IPathService pathService)
at Ranorex.Plugin.Mobile.Utils.BackgroundWorkerSupported.ExecuteBgwCode[TArg0,TArg1](BgwDelegate`2 methodDelegate, Int32 doneProgress, String progressText, TArg0 arg0, TArg1 arg1, BackgroundWorker bgw)
at Ranorex.Plugin.Mobile.Tools.Android.Instrumentation.ApkFileInstrumenter.Instrument(String apkFilePath, Int32 port, InstrumentApkOptions deployOptions, BackgroundWorker bgw)
at Ranorex.Controls.Instrumentation.Workers.AndroidWorker.Run()
at Ranorex.Controls.AndroidInstrumentProgressPage.bgw_DoWork(Object sender, DoWorkEventArgs e)
Code: Select all
using System.Threading;
using WinForms = System.Windows.Forms;
using Ranorex;
using Ranorex.Core;
using Ranorex.Core.Testing;
namespace ParkinsonAutomation
{
public partial class DeployAppToDevice
{
/// <summary>
/// This method gets called right after the recording has been started.
/// It can be used to execute recording specific initialization code.
/// </summary>
private void Init()
{
// Your recording specific initialization code goes here.
}
public void DeployAppToDevice_Deploy_Android_App(string apkname)
{
var _ts = new TimeSpan(0,20,0);
Report.Log(ReportLevel.Info, "Application", "Deploying android app 'C:\\Users\\user\\Downloads\\" + apkname + ".apk' to device 'automation-android-1'.");
Host.Local.InstrumentAndDeployAndroidApp("automation-android-1",
"C:\\Users\\user\\Downloads\\" + apkname + ".apk",
true,
Host.DeploymentModes.Usb,
new Duration(_ts)
);
}
}
}
has anyone encountered the issue of instrumentation code ignoring the allocated duration?
Instrumentation failed. Error:
Process did not finish within the specified timeout of '00:02:00'.
Info: Exec: C:\Program Files\Java\jre7\bin\java.exe -jar "C:\Program Files (x86)\Ranorex 5.3\Bin\RxEnv\Android\tools\apkTool\apktool.jar" d "C:\Users\zshapira\AppData\Local\RanorexStudio5\RxEnv\Android\temp\xxxxxxx.apk" -f -o "C:\Users\zshapira\AppData\Local\RANORE~1\RxEnv\Android\temp\decomp"
Info: Decompiling APK File.
Info: Processing file 'xxxx.smali' (Pass2).
...
...
...
Info: Recompiling APK File.
Ranorex.Instrumentation.exe /help -- Display general help.
Ranorex.Instrumentation.exe /pagename:n /help -- display specific help.
d, device The name of the device to that the APK file shall be
deployed. This parameter is not required if deploymode is set
to 'NoDeploy'.
a, apkfile Required. The path where the APK file resides.
s, skip Default is False. Set this switch to skip APK file
instrumentation prior to deploying.
dm, deploymode Possible Values: WiFi, Usb, NoDeploy, Auto. Default is Auto.
Specifies how the apk file shall be deployed. Set to nodeploy
if the file shall not be deployed to the device. Auto means
the connection mechanism used to configure the device will be
used.
o, outfile Sets a custom output location for the instrumented file. This
can be a directory or a file path. Read/Write permission is
required for this path. If a directory was specified, (to
specify a directory add a trailing '\') the process will
place the APK file in it with the -instrumented suffix added
to the source file name. If the file already exists it will
be overwritten. This option only has a effect if an APK is
instrumented (no skip).
p, pagename Default is UserSelect. Set this option to directly navigate
to a specific page. Is also required for automated command
line based instrumentation. Pages are: android, chrome,
firefox, flex, ios, java, safari. Note: The default 'Select'
is not supported in the command line.
?, help Default is False. Displays command line arguments help.