Difference in Script execution in INSTRUMENTED or NON-INSTRUMENTED MODE?


#1

Hi,

Just want to understand what is the Difference in Script execution in INSTRUMENTED or NON-INSTRUMENTED MODE? Means what benefits we will be getting if scripts are executed in INSTRUMENTED mode by giving the below mentioned capabilities:

dc.setCapability(SeeTestCapabilityType.INSTRUMENT_APP, true);

Thanks


#2

Instrumentation allows us to run native code within the scope of the application.

It’s a useful feature that enhances the capabilities of your test automation.

one example, it allows us to run Javascript on a Native WebView and help you with automation of hybrid applications.

in-general, it increases the speed of your automation, and allows you to operate on a wider range of your application objects

however, it is not a mandatory requirement by Appium Studio and if you don’t want to use the instrumentation , most chances are that you’ll be able to fully automate your scenarios on a non-instrumented app


#3

Thanks Tom for the Info


#4

How to find out the application both (Browser and native app)'s page is instrumented or not by using code,
Because some pages are taking too much time to change Instrumented mode in my application(Safari browser web application). I tried to open Object Spy at 1st time after my page got loaded, It is in Non-Instrumented Mode, Then i waited few seconds(nearly 60sec) i closed and reopened Object Spy then it is showing Check-Box checked Instrumented Mode.

I’m running my tests in Fast Mode, it is giving problem to me…

How we can verify the current page is Instrumented or not by code itself at the time of test run…
or How to change Instrumented Mode if page is not instrumented… At Run Time…

Please help me, We are about to completed feasibility on Appium Studio community edition.

Thanks in advance !
Elango


#5

Hi Tom,

Can u explain me more about “in-general, it increases the speed of your automation” ?
Why instrumented mode make atumation faster ?

Thank you
Daniel


#6

Instrumented code runs as a part of the application under test

it means that if has access to the UI objects from the application layer, unlike UIAutomator frameworks (non-instrumented)

hence, queries such as dump (object spy) click or send text to elements are performed faster.

Again, the main reason is that querying the elements (getPageSource()) runs faster in the instrumented context…


#7

Introduction: I am Testing an APP(Native App) on Ipad.

Tom, I have a question, There are few controls on Ipad App, which I can identify in the Instrumented mode(Checking Instrument Checkbox in object Spy) but the same cannot be identified when I Uncheck Instrument Checkbox in object Spy.

1.Is this called Instrumented and Non instrumented modes?
2.When in Instrumented mode, I copy the xpath and paste it in code and run it , it is not identifiable during run time.
Please help stuck with this issue


#8

when executing you need to make sure that you launch your application with the instrumented flag

dc.setCapability(SeeTestCapabilityType.INSTRUMENT_APP, true);

this way the instrumented context will be focused upon launch

to switch between context during execution, use the driver.context command

e.g
driver.context(“NATIVE_APP_INSTRUMENTED”) - > for instrumented context
driver.context(“NATIVE_APP”) -> for non insturmented context


#9

It’s been my experience that the more layered/complicated the iOS application is, the higher the likelihood of needing instrumentation. I have experienced many cases where I can’t see elements when not instrumented, but can see them when instrumented.


#10

Tom, I am using C# can you please help me with this code in C#.

Can I use dc.SetCapability(“instrumentApp”, true); instead of dc.setCapability(SeeTestCapabilityType.INSTRUMENT_APP, true); because the SeeTestCapability reference I am not able to add in Visual STudio

driver.context is a property in C#
Can I use driver.context = “NATIVE_APP_INSTRUMENTED” Instead in C#


#11

I can’t speak for c# (but you can look at the c# source), but in java I can use the “instrumentApp” technique and it works fine.

public interface SeeTestCapabilityType {
String PLATFORM_VERSION_NUMBER = “platformVersionNumber”;
String DEVICE_MANUFACTURE = “deviceManufacture”;
String DEVICE_MODEL = “deviceModel”;
String DEVICE_LOCATION = “deviceLocation”;
String DEVICE_QUERY = “deviceQuery”;
String DEVICE_CATEGORY = “deviceCategory”;
String DEVICE_WITH_AUDIO = “deviceWithAudio”;
String INSTRUMENT_APP = “instrumentApp”;
String REPORT_FORMAT = “reportFormat”;
String REPORT_DIRECTORY = “reportDirectory”;
String TEST_NAME = “testName”;
String PROJECT_BASE_DIRECTORY = “projectBaseDirectory”;
String USERNAME = “username”;
String PASSWORD = “password”;
String PROJECT_NAME = “projectName”;
String RESERVATION_DURATION_MINUTES = “reservationDuration”;
String WAIT_FOR_DEVICE_TIMEOUT_MILLIS = “waitForDeviceTimeout”;
String USE_REMOTE_GRID = “useRemoteGrid”;
String CONSOLE_LOG = “consoleLog”;
String ST_DEVICE_NAME = “stDeviceName”;
String NV_PROFILE = “nvProfile”;
String DONT_GO_HOME_ON_QUIT = “dontGoHomeOnQuit”;
String DONT_STOP_APP_ON_RESET = “dontStopAppOnReset”;


#12

Did you found any solution for your problem no.2 ? I’m also facing the same problem. Please share your solution.
Thanks.