Thursday, December 7, 2017

Java Basic Programming with Eclipse IDE - 1



How to write a Java program and run in Eclipse IDE :

1) Download Eclipse in your machine . Click here to download.
2) Install Eclipse in your machine , before that ensure that JAVA is installed .
3) After installing both Java(To check Java is installed correctly ,
    refer "JMeter Introduction" Page) and Eclipse, Open the Eclipse by double clicking
    the eclipse icon.           
4) When Eclipse is Opened, it will ask for the WorkSpace ( it is nothing but where your
     projects will be stored), Create the WorkSpace by giving preferred name.


5) Once the Eclipse IDE is opened , you will be seeing 2 perspectives (Windows)

               1) Project Explorer -  where you can create packages , classes etc.
               2) Java Editor -  where you can write the Java coding .



6) Create a Java Project in Eclipse IDE(Hello World Project)

       1) Right Click in the Project Explorer and Select New > Java Project.
      2) Specify the name as "HelloWorld" in the Project Name and Click Finish.
      3) Then the project will be created in Project Explorer.



7) Create a Package in the Java Project

       1) Right Click in the "SRC" Folder and then Select New > Package.
      2) Give the Package Name as "com.HelloWorld" and Click Finish.
      3) Now you can see the "com.HelloWorld" Package in the Project Explorer.



8) Create a Class in the Java Project

       1) Right Click in the "com.HelloWorld" Package Name and Select New > Class.
      2) Give the Class Name as "HelloWorld" and Click Finish.
      3) Now you can see the "HelloWorld.class" is created in the "Project Explorer"
           and Default code is generated in the Java Editor.



9) How to Run and Print the "Hello World " in the Console

      1) Use "System.out.println("Hello World");" to Print the Hello World as the
           Output in the Console.
      2) Then Right Click in the Project and Select Run As > Java Application.
      3) Then "Hello World " Output can be seen in the Console.



10) HelloWorld Program

              package com.HelloWorld;

              public class HelloWorld {

      public static void main(String[] args) {

System.out.println("Hello World");

       }

               }

Thanks ,

A M Balaji

Monday, December 4, 2017

Appium Introduction



Mobile software application(Native/Hybrid) is increasing day by day and now software companies are converting their Web Applications to Mobile Applications.To test the functionality of the application , we need some tool and to stay connected with new technology . Appium(Automation) tool is currently trending in Mobile Automation Industry which is used to do mobile automation testing.

Appium is similar to selenium web driver(Used for Web Application Automation).It will be easy to learn Appium if he/she has the knowledge of how selenium web driver works and Basics of Java Programming .

Here we are going to see about What is Appium and Why is Appium?

 1) Appium tool is used to automate Mobile Web Applications , Native Applications and
     Hybrid applications.
2) It is a open source automation tool which is used to automate both Android(Windows)
    and IOS(MAC) Applications.
3) Appium is a "cross platform" automation tool , Which enables you to reuse large
    amount of codes(If it uses same API).
4) Appium supports test automation on both emulator and physical devices(Preferred:
    Based on the execution speed).
5) Appium supports many programing languages like Java(Prefered),PHP and C# etc..
6) Appium supports many platforms like Android ,IOS and FirefoxOS.
7) No source code is needed to test the app , can test directly with the App itself.
8) Can use Built in apps like camera , calendar etc , if your test script needs.

Limitations of Appium :

1) For Android , No Support for API level < 17. (Prefered Selendroid for API < 17).
2) Script execution is slow in IOS.
3) Gestures support is limited.
4) No support for Toast Messages.

Thanks,

A M Balaji

Tuesday, November 28, 2017

JMeter – Server Performance Metrics Collector




JMeter has many listeners which provides information such as Response Time,Error Percentage,Throughput and etc.

But Server Performance Metrics Collector is used to collect server performance like CPU Utilization,Memory Utilization etc..

Here we will see the steps one by one to Configure Server Performance Metrics Collector.

Step 1: Install Server Agent in Server Machine

   1) Download the latest Server Agent from JMeter Website.
   2) Unzip the file and move  in some folder in the server
       (Java should be installed in the server).
   3) Then Open the port 4444(Default) on the server machine.
   4) To Start the Server Agent use startAgent.bat(Windows) / startAgent.sh(Linux).
   5) 5) startAgent.bat -tcp-port 5555(Use this command for different port).

Step 2: PerfMon Metrics Collector

    1) This is the separate listener ,which can be downloaded from JMeter
         (Standard Set Plugins).
    2) Unzip the plugin folder and copy the files to that and paste in "JMeter/lib/ext" folder.
    3) Otherwise use Plugin Manager in the JMeter to download the plugins.
    4) Then Restart JMeter .
    5) Now in listeners , PerfMon Metrics Collector can be seen.

Step 3: How it Works

    1) Open JMeter , Create JMeter Project with basic elements .
    2) Then add PerfMon Metrics Collector in the JMeter Test Plan.
    3) Before adding any stuff in PerfMon , Make sure Server Agent is running in the
        Server Machine.
    4) Then add a Server IP , Port and Metrics to Collect in the as given in the
        image below.
    5) Thats it , Start the JMeter Test Now.



Thanks,

A M Balaji

Saturday, October 21, 2017

How to Perform Distributed Testing Using JMeter




JMeter is having some limitations while running the load testing from the single machine. So that we are using "Distributed Testing" for Load/Performance Testing . i.e) Master(Controller) and Slave (Load Generator) configuration.Here we can add many slaves and can generate more .



Note: If configuration is not done properly , then it may give wrong results or may not run properly.

There are some prerequisites should be done before starting distributed load testing.

1) Firewalls on the master and slave systems should be turned off.
2) The systems should be in the same subnet.
3) Make sure JMeter can access the servers.
4) Same version of JMeter should be installed in master and slave systems.

Now do the steps to start the Distributed load testing .

Step 1: Go to jmeter.properties > Open it.
Step 2: Search for "remote_hosts" in that file .
Step 3: Add the Slave IP's in that remote_hosts.



After that start the jmeter-server.bat in all the master and slave machines.

Then run the JMeter , by clicking the jmeter.bat(or)ApacheJMeter.jar file and goto Run > Remote Start.Where you can see the Slaves IP Address.



Thanks ,

A M Balaji

Tuesday, September 26, 2017

How to generate Report Dashboard in JMeter





Steps to Create Report Dashboard in JMeter

1) Create a JMeter(.jmx) file as per the requirement , if it has large number of users ,then go for Non GUI Mode as discussed in the previous post ,otherwise run it from the JMeter GUI Mode Itself.
2) While Creating add a Listeners in the JMX File.
3) After completing the Load / Performance Test , go to the Listeners and Save the data as .csv file , if the Load / Performance Test is done from the GUI Mode.
4) If it is ran from the Non GUI Mode , then open the same JMX File in JMeter and Add Listeners in that.
5) Then Browse the JTL from the Listeners and the data will be shown in the JMeter.
6) Save that as .csv File by clicking "Save Table Data".
7) Then open reportgenerator.properties from JMeter > Bin Folder , Copy all the content from the properties file.
8) Open user.properties from the same path as mentioned above and Paste all the content and then "Save".
9) Now run the below mentioned command in the command prompt.
10) jmeter -g "Path of .csv file" -o "Path for Reports"(Dont Create as "ReportD"),
as it will be automatically created from JMeter itself ).
11) Finally Reports will be generated in the "Path for Reports/ReportD".

Next Topic will be followed in up coming posts😊😊😊.


Thanks

A M Balaji



How to Solve "Out of Memory Error" in JMeter


                



There are 2 ways to solve this issue
1) Increasing Heap Size.
2) Running JMeter in Non GUI Mode.

How to increase Heap Size in JMeter

1) Open jmeter.bat File(JMeter > Bin ), Search for "Heap" in the File.
2) You will be finding some thing as "HEAP=-Xms512m -Xmx512m".
3) In this , change the second part as -Xmx1024m(Depends on your system RAM,can be given upto 80% of the RAM Size).
4) Then start JMeter by double clicking the jmeter.bat file .

Running JMeter in Non GUI Mode

1) Before running JMeter in Non GUI Mode , Make sure you have not added any "Samplers" in JMeter
2) Do all the stuffs in JMeter to do Load / Performance Testing , Such as Recording HTTP Requests, Threads(Users) as per the requirement .
3) Save the JMeter File in JMeter > Bin Folder  .
4) Open the Command Prompt and Navigate to JMeter > Bin Folder
5) Then type the command as "jmeter -n -t YourFile.jmx -l YourFile.jtl"
Where, -n indicates Non GUI Mode
             -t indicates JMX File
            -l indicates Log File(JTL File)

Next Topic will be followed in up coming posts😊😊😊.


Thanks

A M Balaji

Friday, September 15, 2017

Basic Elements required to do Load/Performance Testing in JMeter



                    



Below mentioned elements are required for JMeter Basic Load / Performance Testing.

1) Test Plan
2) Threads Group > Recordings
3) Workbench > Http(s) Test Script Recorder
4) Basic Listeners
1) View Result Tree
2) Summary Report

Here Test Plan and Workbench will be Shown when the JMeter is freshly opened (Open JMeter using jmeter.bat for Windows in JMeter > Bin Folder) and (for Linux jmeter.sh).

User can add above mentioned elements manually one by one (or) Click the "Templates" which is located in the Menu Bar,Which will create all Basic Elements of JMeter to do Load / Performance   Testing.

Test Plan : A test plan is the top level body of JMeter, explains sequence of steps execute at run  time.

Threads Group: The name,Thread Groups represent a group of Threads. Under this group, each   thread simulates one real user requests to the server.

Thread Group will be having 3 Properties :

       1) Number of threads - the number of users you are going to test.
   2) Ramp-up time -  The time set by the users to execute the no. of threads.
   3) Loop count - How many times the test should be looped.
   
Recordings : Here the script will be recorded automatically , when user records the Request from Mobile(Look at the Post 2 and 3) for Automatic Recording.

Workbench > Http(s) Test Script Recorder : From Here only user will start the JMeter Proxy to record the Script under "Recordings" ( Look at the Earlier Post).

View Result Tree : Here user can see the request and responses for each and every  Http Requests which is recorded.

Summary Report : Here user can see the Min,Max and Avg Response time , Errors and such other information for each and every request.



Next Topic will be followed in up coming posts😊😊😊.

Thanks

A M Balaji



Record Scripts from IOS Native Mobile Apps using JMeter

                                                             

                     


Step 1: Both Laptop and IOS Device should be same network, i.e) Both should be in same WIFI

Step 2: Check the IP of the Laptop,by typing IPCONFIG in the command prompt.   

Step 3: In IOS Device, goto Settings > WIFI , then Tab on the connected WIFI.

Step 4: After that tap on the "Manual" Option.

Step 5: Next give the IP Address in the "Server"(Which is taken from the Laptop Using IPCONFIG) and "Port" as 8888(Default Port for JMeter).

Step 6: Next open the JMeter 

    1) Click on the Templates in the Menu bar and then select "Recording"(default)
        and select OK

    2) Then select http(s) Test Script Recorder from the Workbench and Check the port , 
         it should be 8888 

    3) Then click on the Start Button to record the script for the specified App.

    4) Check whether the script in recording by clicking on the
        Thread > Recording Controller.

    5) If it is not recording , then restart both the Device and JMeter.

    Note : When user clicks on the Start Button in http(s) Test Script Recorder ,
               new popup will open with the certificate(Valid for 7 days) which will be seen in
               JMeter > Bin folder.

 

                            For IOS Mobile Configuration Check the Below Mentioned Image

                                                          

                                        


        Next Topic will be followed in up coming posts😊😊😊😊😊

     

      Thanks

      A M Balaji

Wednesday, September 13, 2017

Record Scripts from Android Native Mobile Apps using JMeter

                                                             

                    

Step 1: Both Laptop and Android Device should be same network, i.e) Both should be in same WIFI. 

Step 2: Check the IP of the Laptop,by typing IPCONFIG in the command prompt.   

Step 3: In Android Device, goto Settings > WIFI , then Long Press on the connected WIFI, then select the "Modify Network" Option in that.

Step 4: After that tap on the "Advanced Options" , then select the Proxy as "Manual".

Step 5: Next give the IP Address in the "Proxy hostname"(Which is taken from the Laptop Using IPCONFIG) and "Port" as 8888(Default Port for JMeter) and then Save it.

Step 6: Next open the JMeter 

    1) Click on the Templates in the Menu bar and then select
        "Recording"(default) and select OK

    2) Then select http(s) Test Script Recorder from the Workbench and Check the port , 
         it should be 8888 

    3) Then click on the Start Button to record the script for the specified App.

    4) Check whether the script in recording by clicking on the
        Thread > Recording Controller.

    5) If it is not recording , then restart both the Device and JMeter.

    Note : When user clicks on the Start Button in http(s) Test Script Recorder ,
               new popup will open with the certificate(Valid for 7 days) which will be seen in
               JMeter >  Bin folder.
 
   The above mentioned steps(from Step 6 > Step 3) will work if the Android App is
   "HTTP". If the Testing App is with "HTTPS", Then install the Generated Certificate
    in the mobile device (Certificate will  be seen in the JMeter > Bin folder).

                       For Android Mobile Configuration Check the Below Mentioned Image


                                        


        Next Topic will be followed in up coming posts😊😊😊😊😊

    

      Thanks

      A M Balaji

Tuesday, September 12, 2017

JMeter Introduction




Introduction


JMeter is an Open Source testing software. It is 100% pure Java application for load and performance testing. JMeter is designed to cover categories of tests like load, functional, performance, regression, etc., and it requires JDK 6 or higher. This tutorial will give you great understanding on JMeter framework needed to test an enterprise level application to deliver it with robustness and reliability.

                                                 

  Prerequisites


Before Installing JMeter , Java to be installed in the machine where JMeter is going to be Installed.

How to Install Java in the Machine.

1) If the Machine is 32 Bit , Download 32 bit Java and install in the Machine and then set the environment variables for java . Set JAVA_HOME in Environment Variables
2) Command to verify the java installation in the machine , type the below command in the command prompt. Link to download Java is Click Here
                         1) java -version
                         2) java -d32 -version or java -d64 -version

The second  command is to verify whether installed java version in 32 bit or 64 bit.

3) Then download JMeter ,to download Click Here.

4) After Downloading , extract the ZIP File in Drive(Preferably C: , Because Java will be installed in C Drive by default).

5) After extracting , go to bin folder , double click ApacheJMeter.jar or jmeter.bat file for windows and jmeter.sh for linux to start JMeter.


Next Topic will be followed in up coming posts😊😊😊.

Thanks

A M Balaji