Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

How can I check automatically what is seen and what not? Or at least, how can I organize some partly automatic tests?

IDE: Eclipse (could use also IntelliJ Idea if necessary)

Testing tool: Junit (again, could use something else if advised, but better if it is free)

Application OS: Android

Developer's OS: Linux (could change for MAC or Windows(reluctantly))

Language: Java

All the work goes in the external device. No emulator.

The application is a user wrapper for the firmware TV player, called as external activity. So, 70% of the code is for GUI. (The other 30% speak to servers and provides info to the GUI)

Before I programmed the testing function myself, not using any tools. Now I have a tool at hand. But I can't imagine how could I test the UI, with the tool or without it. (Strictly said, with the Internet connections I have problems too, but I'll leave them probably for the other question.) The answer needn't be too platform-dependent, the principles and ideas will help, too.

Of course, it is good to check, is some element in another and checked or not. Some regression checks would be nice for that. But I should also be sure that the element mentioned is not cut by some other elements and winks as I ordered by animation.

The advices here: Is there a tool to test Java UI? won't help - there are only tools, not principles, and none of the tools could help in my situation.

share|improve this question
    
did you consider asking at sqa.stackexchange.com ? BTW what is available for you to capture in testing - GUI objects, screen pixels, keyboard/pointer device events? –  gnat Feb 3 '12 at 9:28
    
Thank you. I didn't know about that server here. Maybe, later some moderator will move my question there. (BTW, I don't understand why the testing needs its own server). As for your other sentence, I think, it is as usual in Android - objects - yes, pixels - may be, through some tricks? - I don't know, events - yes. Can Junit read pixels from gui? –  Gangnus Feb 3 '12 at 9:38
    
A great open-source automated testing tool for Android is Robotium. –  Corey D Feb 3 '12 at 21:28
add comment

3 Answers

There are testing frameworks that allow you to interact with the screen directly; at my job we use IBM Rational Functional Tester, which allows us to click buttons and so on as well as the usual programmatic testing. Obviously, that's not free, but looking it up on wikipedia provides this list of alternatives. Since you're looking at Java, there's CubicTest, which is an Eclipse plugin; alternatives include Maveryx and Abbot.

share|improve this answer
    
+1 for your attempt. But these tools don't work for Android, as I see. –  Gangnus Feb 3 '12 at 20:13
    
@Gangnus Drat, I was hoping at least one would. I'm not familiar with Android-specific development, unfortunately –  Yamikuronue Feb 3 '12 at 20:42
    
Alas, I have a really hard problem - my app is being debugged not on the emulator, that is in a PC, but on the external Andoid device. So, I am almost sure there is no ready tool for testing it. I should organize the process myself. But how... What have I to check, what are the problems of making such testing, how the regressive test are organized... Everybody gives me links to tools, but I need links to thoughts. Of course, i would take a tool very gladly, but there isn't one... What a sad world... :-) –  Gangnus Feb 3 '12 at 21:11
    
@Gangnus My coworker informs me that even the emulator makes life difficult for debugging the GUI unless you have something designed for it, since it's a whole extra layer to deal with. As for modelling the tests, we use a tool to create flowcharts outlining the path through the program; our tool I think is made in-house, but it has the ability to generate lists of all possible traversals of the flowchart (which become our test scripts), which sounds like a feature you ought to be able to find easily enough or do yourself –  Yamikuronue Feb 3 '12 at 21:35
add comment

I use testcomplete. Its a most comprehensive tool I've used to automate GUI testing. http://smartbear.com/products/qa-tools/automated-testing/ check them out I am really positive that this will be a good fit for you and it does support Java

share|improve this answer
    
Thank you, but it is: a) Windows b) not for Android c) not free. I could overcome "c" and even "a", but "b" is too bad. –  Gangnus Feb 3 '12 at 10:26
    
+1 Anyway, I think, I'll use it in my another project. –  Gangnus Feb 3 '12 at 20:14
add comment

Most often the best advice for automatic GUI testing is to develop your application in a Model-View-Presenter style and write your tests against the Presenter. The topic is discussed here:

http://danbunea.blogspot.com/2005/11/model-view-presenter-is-testing_27.html

(there are further links at the end of that article).

Of course, that might not help you to "check automatically what is seen and what not", but it may help you to test the most of the UI logic.

share|improve this answer
    
Thank you for the article. The problem is, that in my application, on the contrary, the view is the most complicated part, and the presenter and model are primitive enough, and it is view part that I need to test. I want exactly as I have said, to "check automatically what is seen and what not" Or partly automatically. –  Gangnus Feb 3 '12 at 10:10
    
+1, You have conducted me to another question (programmers.stackexchange.com/questions/133134/…) :-) I would be glad to read your opinion on it. –  Gangnus Feb 3 '12 at 10:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.