Forum Discussion
vthomeschoolmom
Super Contributor
Ok, I was given the instrumented app by someone else who cannot remember how it was done. I had read through the tutorial but skipped that part thinking it was done properly. I am not sure given this sentence in the instrumentation documentation.
" However, in this case, you will be able to create only image-based tests. "
I will redo this. Thanks for your help.
S
AlexKaras
6 years agoChampion Level 3
Hi,
> I was given the instrumented app by someone else who cannot remember how it was done.
Note, that application must be instrumented using the same version of TestComplete that will be used to run the test.
P.S. Sample code to check instrumentation:
//----------------------------------------------------------------------------- // From: http://blog.falafel.com/instrumenting-android-apps-ii/ // From: http://blog.falafel.com/instrumenting-android-apps-iii/ function AppInstrumentationVerify(strAppName : string; bStopTestRun : OleVariant = true) : OleVariant; var app : OleVariant; var boolResult : OleVariant; var strMsg : string; begin app := evaluate(aqString.Format('TestedApps.%s;', strAppName)); if (not app.Instrumented) then begin app.UseCustomCertificate := false; app.BackupOriginalAPK := true; boolResult := app.Instrument(); if (boolResult) then Log.Message(aqString.Format( '%s tested application has not been instrumented so TestComplete did this to get access to its internals', aqString.Quote(strAppName)), strAppName) else Log.Warning(aqString.Format( 'TestComplete failed to instrument the %s tested application', aqString.Quote(strAppName)), strAppName); end; boolResult := app.InstrumentedWithSupportedVersion; if (not boolResult) then begin if (bStopTestRun) then strMsg := ' Test run stopped.' else strMsg := ''; Log.Warning(aqString.Format( '%s instrumentation is NOT compatible with TestComplete v.%i.%i.%s', app.APKFileName, getRunningTCMajorVersion(), getRunningTCMinorVersion(), strMsg), app.APKFileName); if (bStopTestRun) then Runner.Stop(false); end; result := boolResult; end; //-----------------------------------------------------------------------------