9/16/16

Mobile App Load Testing

For Android devices:

a. Go to Options – Wi-Fi, long tap on the current network connection and choose the “Modify Network” popup menu item;

b. Check “Show advanced options” checkbox;

c. Set parameter “Proxy settings” to “Manual”;

d. In the field “Proxy hostname” type the IP of the computer (for example, 10.2.0.89), into the field “Proxy port” our port – 8089;

e. Save changes.






4/26/16

Distributed Testing in JMeter

Distributed Testing in JMeter:

Distributed testing is a kind of testing which use multiple systems to perform stress testing. Distributed testing is applied for testing web sites and server applications when they are working with multiple clients simultaneously.Distributes testing uses client-server model as figure below:















Before you start,there are a couple of things to check.

1. the firewalls on the systems are turned off.
2. all the clients are on the same subnet.
3. the server is in the same subnet, if 192.x.x.x or 10.x.x.x ip addresses are used. If the server
doesn't use 192 or 10 ip address, there shouldn't be any problems.
4. Make sure JMeter can access the server.
5. Make sure you use the same version of JMeter on all the systems. Mixing versions may not work
correctly.



Master: the system running JMeter GUI, control each slave.

Slave: the system running jmeter-server, receive command from the master and send a request to server under test.Target: the web server under test, get request from slaves.
System configuration:
On the slave systems, go to jmeter/bin directory and execute file "jmeter-server.bat".
On the master systems, go to /bin directory and edit file jmeter.properites, add IP slave machine as below




Run the test:
On the master machine, run JMeter GUI and open the test plan.Click Run on the menu bar; select Remote start -> select the IP address of slave machine


JMeter in Non GUI mode

How to run JMeter in Non GUI mode:


Running JMeter using command line in non-GUI mode is very simple.
1. Open your *.jmx file
2. Remove all graphic data writers
3. In the non-gui mode they will not work, and it is no need to keep them in testing scenario.
4. Open command prompt
5. Go into JMeter’s bin folder

6. Enter following command, jmeter -n –t test.jmx -l test_results.jtl









-n: It specifies JMeter is to run in non-gui mode
-t: Name of JMX file that contains the Test Plan
-l: Name of JTL(JMeter text logs) file to log results
-j: Name of JMeter run log file.

Other than these options, JMeter has several other parameters that can be used for running in the non-GUI mode.
-R: list of remote servers,
-H: proxy server hostname or ip address
-P: proxy server port.

View test result:
Once your test is complete, you will see the following display:
















After completing the test, a JTL file will be generated at jmeter2.12/bin folder
Follow below steps to view test results from the resultant JTL file.
Open JMeter in GUI mode.
Add any listener Eg. View Results Tree.
Click Browse button of the file name field in listener.
Open testresult.jtl file.
You should be able to see the result in listener now.


4/20/16

Jmeter

About Jmeter
               
                The Apache JmeterTM is pure Java open source software, which was first developed by Stefano Mazzocchi of the Apache Software Foundation, designed to load test functional behavior and measure performance. You can use JMeter to analyze and measure the performance of web application or variety of services. Performance testing means testing a web application against heavy load, multiple and concurrent user traffic. JMeter originally is used for testing Web Application or FTP application. Nowadays, it is used for functional test, database server test etc.

Steps to Install JMeter

Step 1) Install Java

JMeter is pure Java desktop application, it requires a fully compliant JVM 6 or higher. You can download and install the latest version of Java SE Development Kit
Step 2) Download Jmeter
Download latest version of JMeter

Step 3) Installation

Installation of JMeter is extremely easy and simple. You simply unzip the zip/tar file into the directory where you want JMeter to be installed. There is no tedious installation screen to deal with! Simple unzip and you are done!
How to Open JMeter.

After downloading JMeter, go to the bin directory. In this case, it is/home/manisha/apache-jmeter-2.9/bin and click on jmeter.bat.






  













Test Plan is where you add elements required for your JMeter 
The WorkBench simply provides a place to store test elements temporarily. WorkBench has no relation with Test Plan. JMeter will not save the contents of the WorkBench. It only saves the contents of the Test Plan branch    

4/16/16

TRY-SCRIPT:-

We can Try-Script…by clicking the green colored    “Start button” in toolbar.

View Results Tree MUST NOT BE USED during load test as it consumes a lot of resources (memory and CPU). Use it only for either functional testing or during Test Plan debugging and Validation.

Post-Recording and Try script

Post-Recording and Try script
After-Recording:-
Remember to do Four things….
1. Click on test plan and save the script with new name.
2. For Try Script you need to add View Result Tree.
Add (Thread Group) -> Listener -> View Result Tree
3. Add Cookie Manager and Cache Manager
Add (Thread Group) -> Config Element -> HTTP Cache Manager
Add (Thread Group) -> Config Element -> HTTP Cookie Manager
Do required setting in cookie and cache manager.
4. To comment by right click on the request and disable.
5. Customization (Add CSV file.)
Right click on thread group click ->Add -> Config Element -> CSV Data set Config
1. Create Data file at Bin folder of JMeter (Eg. Login.csv).
2. Make the setting as shown in below fig

















3.Change Variable name as follow:

























6.Parsing (Add regular expression extractor).
To check parsing you can use RegExp Tester in View Result Tree.



























7. Right click on request Add -> Post Processors -> Regular Expression Extractor














The special characters above are:
( and ) - these enclose the portion of the match string to be returned
. - match any character
+ - one or more times
? - don't be greedy, i.e. stop when first match succeeds

8.Adding Verification Point (Assertion)
Right click on request Add -> Assertion -> Response Assertion






















Adding ThinkTime:
Right click on Transaction controller  Add (Transaction controller) -> Sampler-> Test Action.

Recording

Click on start button in ‘HTTP(S) test script recorder’ and manually open the browser.
For every new page add new transaction counter and change ‘Target Controller’ menu in HTTP(S) test recorder to timer name (transaction counter name).

After Recording is completed press stop button in ‘HTTP(S) test script recorder’.