tag:blogger.com,1999:blog-25456655.post7546000981851205735..comments2024-02-09T11:53:32.369-05:00Comments on Diego Torres Milano's blog: Android Testing: Running tests from codeDiego Torres Milanohttp://www.blogger.com/profile/12030778501784140349noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-25456655.post-17229277105847111072022-03-02T14:28:36.203-05:002022-03-02T14:28:36.203-05:00Hi Diego,
thank you for the suggestion. On follow...Hi Diego,<br /><br />thank you for the suggestion. On following above steps getting null pointer exception, <br /><br />java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.UiAutomation.setOnAccessibilityEventListener(android.app.UiAutomation$OnAccessibilityEventListener)' on a null object reference<br /><br />Any input here is really appreciable.<br /><br />Dipti Joshi : did you get any solution ? or if any other method followed to start the instrument from the app ?Deepakhttps://www.blogger.com/profile/04458640097440139386noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-29019930435413847722020-02-06T06:41:35.058-05:002020-02-06T06:41:35.058-05:00Hi Diego, Thanks for your post, it has helped me a...Hi Diego, Thanks for your post, it has helped me a lot!!! I however am facing an issue wherein I have to initialise the UiDevice object and I am doing it in the @Test and not @Before function. However I get the error;<br />java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.UiAutomation.setOnAccessibilityEventListener(android.app.UiAutomation$OnAccessibilityEventListener)' on a null object reference. This is at the line;<br />Instrumentation instr = InstrumentationRegistry.getInstrumentation();<br />mDevice = UiDevice.getInstance(instr); ----------------------------------here<br />Can you please help me in solving this error?<br /><br />Thanks,<br />DiptiDipti Joshihttps://www.blogger.com/profile/00678401200349681451noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-16147650203384151612012-12-06T20:42:54.203-05:002012-12-06T20:42:54.203-05:00Actually, I cannot figure out your link..
Becaus...Actually, I cannot figure out your link.. <br /><br />Because, No one can invoke the runTests() method.<br /><br />Then, I just re-check the your source code.<br /><br />And, I found that you added the runTests() in menu option!.<br /><br />So, when I just execute the app, then, I push the menu btn, And execute the runTests() method...<br /><br />That was successful! Thanks a lot!<br /><br />But, my question is that..<br /><br />When I just execute the app and instrumentation starts at the same time!..<br /><br />is that possible?EffantTerriblehttps://www.blogger.com/profile/02913435410830732103noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-89505142032349156692012-12-06T10:39:26.003-05:002012-12-06T10:39:26.003-05:00@EffantTerrible,
You can find a working example a...@EffantTerrible,<br /><br />You can find a working example at <a href="https://github.com/dtmilano/I2AT-OSCON-2012/blob/master/TemperatureConverter-OSCON-2012/tests/src/com/dtmilano/i2at/tc/test/TemperatureConverterTestsActivity.java#L97" rel="nofollow">TemperatureConverterTestsActivity.java</a>.<br />Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-69073596012717341082012-12-06T03:47:48.864-05:002012-12-06T03:47:48.864-05:00Where am I have to put that code?
I don't kno...Where am I have to put that code?<br /><br />I don't know..<br /><br />target class? or instrumentation class?<br /><br />I added target class..<br /><br />I added in onCreate() method..(startInstrumentation...this code)..<br /><br />But, when my app executing...it just execute infinitely ~~..<br /><br />I don't know where am I put that code..<br /><br />please~help me<br />EffantTerriblehttps://www.blogger.com/profile/02913435410830732103noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-53385763332031113792012-12-06T03:45:39.704-05:002012-12-06T03:45:39.704-05:00This comment has been removed by the author.EffantTerriblehttps://www.blogger.com/profile/02913435410830732103noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-67502915485842587442012-03-28T01:54:10.112-04:002012-03-28T01:54:10.112-04:00how to collect the xml report?how to collect the xml report?ytsolarhttps://www.blogger.com/profile/13922640360927930072noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-17158846812708973322012-03-20T11:33:55.922-04:002012-03-20T11:33:55.922-04:00This sort of thing is useful when testing applicat...This sort of thing is useful when testing applications "in the wild". Sitting at a desk, indoors, with good WiFi is NOT a good scenario for mobile computing and yet that's where too many QAs do their tests. Take a bus ride through the city, attempt to use the app at a busy event such as a soccer game, just go outside in the sunlight and see how it reads on your screen. <br /><br />Another good scenario is if you're working on an app for a client and want to have them walk through a demo script. You can use a test script that is executed locally exercise the app while they watch the actions. This sort of demo is MUCH more effective than simply providing screenshots or video.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-25456655.post-80525410227451140002011-11-30T23:21:01.357-05:002011-11-30T23:21:01.357-05:00DevTools is doing something like that, using the P...DevTools is doing something like that, using the PackageManager to obtain the available Instrumentations and then populating the list.<br /><br />Does this answer your question ?Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-5941161358449533642011-11-30T12:14:27.911-05:002011-11-30T12:14:27.911-05:00Hi, I wonder to see this happening from programiti...Hi, I wonder to see this happening from programitically. It seems same like as DevTools.apk application can give the Option for Instrumentation. Once we can tap on this It can give the list of "Instrumentation Tests" applications.<br /><br />Thank you for sharing this information us<br /><br />Regards,<br />Obula reddy<br />Agile Test EngineerAnonymoushttps://www.blogger.com/profile/00526415556060315695noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-46673001050198337722011-09-14T05:58:44.059-04:002011-09-14T05:58:44.059-04:00Hi Diego,
This was too interesting can u explain i...Hi Diego,<br />This was too interesting can u explain in detail how to do this.?<br />with help of some example..I interested to know more about this.Panduhttps://www.blogger.com/profile/01979257545342103036noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-81827919691095251392011-09-08T09:51:16.571-04:002011-09-08T09:51:16.571-04:00Yes, exactly. That's why I mentioned not havin...Yes, exactly. That's why I mentioned not having a <b>computer</b> at all, not just not being able to connect the device through USB.<br /><br />Perhaps you want to tests on hundred of devices, who knows...Diego Torres Milanohttps://www.blogger.com/profile/12030778501784140349noreply@blogger.comtag:blogger.com,1999:blog-25456655.post-39471951632399736872011-09-08T01:51:08.612-04:002011-09-08T01:51:08.612-04:00If you don't have a physical USB connection, c...If you don't have a physical USB connection, connecting ADB over WiFi is trivial. I can't think of a reason to do this.PsuedoNoisehttps://www.blogger.com/profile/15524275352388106372noreply@blogger.com