Sunday, February 26, 2012

JInjector - J2ME Instrumentation testing


JInjector is an Instrumentation tool for Java Mobile Applications. 

J2ME applications consist of having a pair of files: the JAR and JAD. JAR file containing all the code and resources and JAD file is a text based containing execution parameters. The Deployment is J2ME applications as these tend to include code optimization and obfuscation, together with signing also.

Here the JInjector applies the Instrumentation and resulting classes are pre-verified and packaged together a specific device. But the Initial jar file should not obfuscated (or) optimized. The whole process and the testable code must be preverified again and The JAD descriptor file needs updating with the new JAR size. It instruments the system under test (SUT) in order to run automated tests in emulators and on the actual devices and It can also supports for code coverage.

Below the sample screenshot for the overall architecture



How to instrument LCDUI
LCDUI has strong has encapsulation and those classes cannot be instrumented. Because they are not part of the JDK. For Java Reflection They have done Java byte code conversion - a general purpose instrumentation tool based ASM

The Java ME code:
                        Form form=new Form();
                        form.addCommand(command1);
            Will be instrumented as
                        Form form=new FormWrapper()
                        Form.addCommand(Command1);

Here some of wrapper classes below
Alert- Alert wrapper, Canvas-Canvas Wrapper, Form – Form Wrapper, .. etc

And Wrapper classes have methods like as ……
getTitle();  getCommand(); getAllCommands(); commandListner(); .. etc

Simple test case using wrapper class methods
FormWrapper myForm = (FormWrapper) myScreen;
  assertEquals("The form title should be Sign in","Signin“,myForm.getTitle());
  Command c[]=myForm.getAllCommands();

A Test Method
Package com.reddyapp.test.auth.register;
import com.reddyapp.j2me.JInTestCase;
public class TestHelloMIDlet extends J2meTestCase {
                        public void testRegisterForm (){
                        }
}

Test case Asserts
public void testRegisterForm (){
assertEquals("The form title should be Reddy, “Reddy“, mainForm.getTitle());
}

Test Reporting and Test Results



Sunday, February 12, 2012

Test your mobile web application with MITE (Mobile Internet Testing Environment)

I hope this post can help you to how to present and test your web application accessing through into different devices.

Now a day’s People are spending more time on mobile devices and Tablet P.Cs than to traditional computers. Web Sites must be providing an excellent experience to visitors using one of many thousands of mobile devices. We may expect traffic in the thousands of users every day.

So Development and QA team has to take care of their web pages to present, test and verify that content is correctly formatted & displaying across mobile devices. In these areas you need to be test each and every screen with HTML elements (attributes, content, Styles), Local storage (Offline storage & online storage), cookies and application cache.

Here is some of the useful information about How to launch and view the web page content


Launch the GoMO

Take the URL of your Test web page and paste it in there. You can see your desktop site on a mobile phone. It can help you to improve the customer or User web view experience

The mobile Web view results will be displayed as per below


MITE comes with a script recorder that lets you capture each step as you navigate a mobile website and also you can be able to test many devices at time

Here are some open source tools for I Phone Browser test and debugging for your I phone web application

I Phone Browser testing:  iwebinspector

Cross verify your mobile web features with below link
HTML5 compatibility on mobile and tablet browsers: Web features Cross verification