Tuesday, April 12, 2011

Android App Testing



Robotium

Robotium is java based (jar) and can be run through Eclipse IDE.

Robotium officially supports Android 1.6 and up.

For more information on features of this Apache open-source tool, please click on the above link.

Sunday, April 10, 2011

Test

1. What does SIDE stand for?


2. What is a GPL (General Public License)?


3. What are main components of the Selenium Toot-kit?


4. I installed Selenium IDE from Internet Explorer and then installed Firefox browser. Would it work, please explain?


5. What is the use of “Clipboard Format” in IDE?


6. What is the use of “Find” button on IDE?


7. What is difference between “assert” and “verify” commands?


8. What must one set within SIDE in order to run a test from the beginning to a certain point within the test?


9. What does a right-pointing green triangle with one line at the commands icons in IDE indicate?


10. What distinguishes between an absolute and relative URL in SIDE?


11. When ran as part of the whole Test the command runs fine but when I run it through the option "Execute this command X" in IDE then it fails, why?


12. How would one access a Selenium variable named "Vcount" from within a JavaScript snippet?


13. How would one access a Javacsript Stored Variable named "vStored" from within a JavaScript snippet?


14. What Selenese command can be used to display the value of a variable in the log file, which can be very valuable for debugging?


15. If one wanted to display the value of a variable named “Vanswer” in the log file, what would the first argument to the previous command look like?


16. Where did the name "Selenium" come from?


17. Which command(s) can be used to check that an alert with a particular message popped up?


18. What command simulates selecting the browser's Back button?


19. Why do you use the ‘click’ command at times and then the ‘clickAndWait’ command at others? What’s the difference?


20. If the Test Case frame contains several test cases, how can one execute just the selected one of those test cases?


21. What is the generic name for an argument (to a Selenese command) which starts with //?


22. How can I change sequence of Test Cases in my Test Suite?


23. How can I change sequence of commands in my Test Case?


24. What is the oddity associated with testing an alert?


25. How can one get IDE to always record an absolute URL for the open command's argument?



26. What are the benefits of using Integrated Development Env like Eclipse?


27. What is the use of importing libraries in the Java code?


28. What is Bromine?


29. What is Selenium GRID?


30. What is the price of Selenium license per server?


31. What is the minimum programming knowledge required to test using Selenium IDE?


32. What programming languages can you use in RC?


33. If you have an application to test which was developed in PHP, can you use Java programming language Test Scripts in RC to test it?

Standard code for @BeforeTest and @AfterTest in TestNG

@BeforeTest
public void setUp() throws Exception {
SeleniumServer seleniumserver=new SeleniumServer();
seleniumserver.boot();
seleniumserver.start();
setUp("http://www.ge.com/", "*firefox");
selenium.open("/");
selenium.windowMaximize();
selenium.windowFocus();
}

@Test public void testTC_GE_EE() throws Exception {
// your testing code goes here
}


@AfterTest
public void tearDown(){
selenium.close();
selenium.stop();
}

----------------

@BeforeTest
public void setUp() throws Exception {
SeleniumServer seleniumserver=new SeleniumServer();
seleniumserver.boot();
seleniumserver.start();

Integer port = 4444;
String browserString= "*firefox";
String url = "http://www.ge.com";
selenium = new DefaultSelenium("localhost",port,browserString,url) {
public void open(String url) { commandProcessor.doCommand("open", new String[] {url,"true"});};
};
selenium.start();

selenium.setTimeout("120000");
selenium.open("/");
selenium.windowMaximize();
selenium.windowFocus();
}

bat file for launching RC

@echo off
echo Starting Selenium RC server. . . Hit Control+C to stop.
pause
cd C:\selenium-remote-control-1.0.3\selenium-server-1.0.3
java -jar selenium-server.jar

Sample CSS file for IDE

table
{
border:2px solid black;
background: lightblue;
font-size: large;
}
td
{
border: 2px solid brown;
padding: 10px;
margin: 0;
}

IDE Test Suite Report

@echo off
java -jar C:\selenium-server-1.0.3\selenium-server.jar -htmlSuite "*firefox" "http://www.ge.com" "C:\GE\GE_TS1.html" "C:\FF\GE_TS1_Result.html"
pause

Note:
Param 1,2,3 - For launching RC
Param 4 - RC Mode
Param 5 - Browser
Param 6 - Base URL of Test Suite
Param 7 - Test Suite file with full path
Param 8 - Name of the Report html file

Important: Before running bat file, run Test Suite manually to ensure that it runs and also check the file paths.