Hi, What about context? Does UiAutomator has a context and I can use context.getClassLoader(). I am interested to know because I want to use DexClassLoader to dynamically call a test case from within another test case. Please see my post at https://groups.google.com/forum/#!topic/adt-dev/Y1upmKD1vlc The title is Dynamically call my uiautomatorTestCase1.jar from uiautomatorTestCase2.jar. I wonder such a thing is possible or not.
Thanks Maryam On Monday, May 6, 2013 2:26:32 PM UTC-4, Guang Zhu wrote: > > Hi, > > Your UI Automator test code can make references to regular Android > framework APIs, because at compile time and runtime, those classes do exist > on classpath; which is why you can get your test code compiled as such. > > However, please understand that UI Automator is meant to be a black-box > testing API framework. Your test code is NOT associated with any particular > app under test, so things like getPackageName(), getApplicationInfo() etc > are meaningless. In fact, your test code does not have a real application > context, so access to Context related classes, methods, services cannot be > done. > > Thanks, > Guang > > > On Mon, Apr 29, 2013 at 12:14 AM, Armaan <[email protected] <javascript:> > > wrote: > >> Can i use the api used in an android application in my uiautomator test >> cases? i add the android.jar in my uiautomator test cases and try to use >> some of the methods of android.app.Activity class like getPackageName(), >> getApplicationInfo(), getParentActivity(), etc.. All it does is return null >> pointer in every case. Can the android library be used with uiautomator >> test cases in any way? >> >> Thanks >> >> -- >> You received this message because you are subscribed to the Google Groups >> "adt-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Guang Zhu > Android Test Engineering > Google Inc. > > Please keep all discussions on related Google Groups, no direct emails. > Thanks! > -- You received this message because you are subscribed to the Google Groups "adt-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
