• Home
  • Company
    • About
    • Customers
    • Testimonials
    • Contact Us
    • My Account
  • Products
  • Downloads
  • Tutorials
  • Professional Services
  • Home
  • Company
    • About
    • Customers
    • Testimonials
    • Contact Us
    • My Account
  • Products
  • Downloads
  • Tutorials
  • Professional Services
Free Edition Compatible
How to Write WEB Load Test
Objectives
In this tutorial you'll learn HOW TO:
► Create multiple HTTP/HTTPS connections to your WEB from Coronys ETS.
► Send all queries at once.
► Measure response time per each connection.
► Generate report with a response time dispersion chart.
All Tutorials
How to ...
Add a New Test Step
Right click on any sibling leaf to add a new "HTTP Load" test step on Test Step Tree:
Define Test Parameters
Define selection time parameters:
Verify that epNoConnections parameter value you set is smaller than a "Number of simultaneously opened resources" available in the ETS Edition you use. 
Contact sales@coronys.com to request a full functional license for a free 30 days evaluation if you need to test a greater number of connections, .
Write a Script
Copy the script below and paste it to the template created by the ESL Editor.
Press F1 in ESL Editor for Help and API index.
DeclareOnce  epURL = "http://www.YourWeb.com"    ; URL under test
     DeclareOnce  epHTTPCommand = "GET"               ; HTTP command to send
     DeclareOnce  epDelay = 0                         ; Interval between send operations in msecs
     DeclareOnce  epNoConnections = 6                 ; Number of connections
     Declare  Status ,  i ,  Time ,  FileName ,  UrlName
     Declare  LUT_Results
     Declare  ID [ epNoConnections ]

     ; Establish HTTP Connections
     For  i  =   0   to  epNoConnections - 1
         HTTP_NewClient  ID [ i ],  epURL
     Next
    
     ; Send a command from each connection
     For  i  =   0   to  epNoConnections - 1
         HTTP_API  Status ,   ` SendHttpRequest ` ,  ID [ i ],  epHTTPCommand
         if  epDelay  >   0   Then   Delay  epDelay
     Next

     ; Create Lookup Table Coronys object (LUT)
     LT_Create  LUT_Results ,   0 ,   1
     ; Set Headers to the 1st row 
     LT_SetValues  Status ,  LUT_Results ,   0 ,   0 ,   "Conn.ID,Resp.Time"

     ; Get response times per channel
     For  i  =   1   to  epNoConnections
         Do   ; Wait until all requests responded
             HTTP_API  Time ,   ` GetHttpRequestTime ` ,  ID [ i - 1 ]
             Delay   200
         Until   ( Time  >=   0 )   ||   ( Time  ==   (- 2 ))
         ; Save response time to the LUT - row per connection
         LT_SetValues  Status ,  LUT_Results ,  i ,   0 ,  i  $   ","   $  Time
         ; Show the progress window
         DisplayInfo   "Loop = "   $  i  $   " of "   $  epNoConnections
     Next
     HideInfo   ; remove the progress window

     ; Close HTTP connections
     For  i  =   0   to  epNoConnections - 1
         HTTP_Delete  ID [ i ]
     Next

     ; Generate file name for Results
     StrInBetween  UrlName ,  epURL ,   "." ,   "."   ; Extract WEB name
    FileName  =   GT_TreeRelativePath   $   "Temp\"   $  UrlName  $   ".html"
     ; Generate Respose Time Dispersion chart to the report
     LT_ReportAsHTML  Status ,  LUT_Results ,  FileName ,   "$<h1>HTTP Load Report</h1><br><h2>"   $  epURL  $   "</h2>" ,   ""
     Chart_Command  Status ,   " ChartFromLUT " ,  LUT_Results ,   "Response Time" ,   "Conn.ID"   , "Resp.Time" ,   "Bar"

     ; Clean LUT by re-creating the object
     LT_Delete  LUT_Results
     LT_Create  LUT_Results ,   0 ,   1

     ; Add a chart to the report and show in your default browser
     LT_ReportAsHTML  Status ,  LUT_Results ,  FileName ,   "" ,   "" ,   1 ,   "" ,   1 ,   1

     ; Close LUT object
     LT_Delete  LUT_Results
    
     End   ;@DBG:NEST - 1 - @DBG:IsInJob; Exit Current Test
Create Test Flow and Run
To launch WEB Load Test:
Drag "HTTP Load" to the Flow Editor - the "User Parameters" window will pop up
Set your parameters. 
Ckick "Run" button to execute.
Reports
The script generates the HTML report containing a response time dispersion chart:
  • Home
  • Products
  • Downloads
  • Tutorials
  • Contact Us
  • Terms of Use
  • Privacy Policy

Copyright © 2002-2017 Coronys Ltd. All Rights Reserved.
 
Back to top