Download presentation
Presentation is loading. Please wait.
1
Javascript Engine in Netstorm
DEMO Javascript Engine in Netstorm
2
Objective Demo inline javascript
Demo javascript in embedded script file Compare HTML response AND Javascript processed HTML response Demo load scenario, where one group is configured with JS engine ON and other group is configured with JS engine OFF
3
Javascript Engine configuration
Keyword: #G_JAVA_SCRIPT <Groupname> <Mode> G_JAVA_SCRIPT Demo1 2 Mode 0 indicates JS engine is OFF for this group Mode 2 indicates JS engine is ON for this group and checkpoints are applied after JS is processed Note: we can define JS engine settings per group Click for sample config file
4
Server file Structure /var/www/hpd/real/default/JavaScript:
index.html - static html file that will always pass test demo_js1.html - html file with inline script code demo_js2.html - html file that has an embedded script file (demo_js2.js) demo_js2.js - script file containing javascript code Click for file contents
5
Scenario 1 (Inline Javascript)
Files: Script Name: scripts/default/default/js_demo1/ Page1 URL - Page2 URL - Scenario - scenarios/default/default/demo_js1.conf Click for config file
6
Scenario 1 (Inline Javascript)
Checkpoint on index.html (will always pass) RESP_ORDER_NUMBER Search Variable on index.html (will always pass) ordernumber Checkpoint on demo_js1.html (will pass when JS engine is ON) loadtag - 2/23/2011 is a cold day
7
Scenario 1 (Inline Javascript)
Response comparison: Wihout JS Engine With JS Engine </head> <body onload="myOnloadFunction()"> <p >Current Date and Time is : <span id=date>none</span> </p> <p id=loadtag>Before Load</p> <p >Variable value is : <span id=var>none</span> </p> <script> var abc = 999; document.getElementById('var').innerHTML = abc; </script> </body> <p>Current Date and Time is : <span id="date">Wed Feb :47:47 GMT+0530 (IST)</span> </p> <p id="loadtag">Loadtag - 2/23/2011 is a cold day</p> <p>Variable value is : <span id="var">999</span> </p> <script><![CDATA[ ]]></script></body>
8
Scenario 2 (Javascrpt in embedded script file) Files
Script Name: scripts/default/default/js_demo2/ Page1 URL - Page2 URL - embedded - Scenario - scenarios/default/default/demo_js1.conf Click for config file
9
Scenario 2 (Javascrpt in embedded script file)
Checkpoint and Search Variable will pass on index.html (same as scenario 1) Checkpoint on demo_js2.html (will pass when JS engine is ON) loadtag - 2/23/2011 is a hot day
10
Scenario 2 Response comparison: Wihout JS Engine With JS Engine
<body onload="myOnloadFunction()"> <p >Current Date and Time is : <span id=date>none</span> </p> <p id=loadtag>Before Load</p> <p >Variable value is : <span id=var>none</span> </p> <script> var abc = 999; document.getElementById('var').innerHTML = abc; </script> </body> <p>Current Date and Time is : <span id="date">Wed Feb :50:41 GMT+0530 (IST)</span> </p> <p id="loadtag">Loadtag - 2/23/2011 is a hot day</p> <p>Variable value is : <span id="var">999</span> </p> <script><![CDATA[ ]]></script></body>
11
Scenario 3 (Load) group 1 (scenario 1 with JS engine ON) +
group 2 (scenario 2 with JS engine OFF) 1000 users in both groups Page Think Time - 15 seconds Session Pacing seconds Click for config file
12
Scenario 3 (Load) progress report
13
Scenario 3 (Load) Trx details
Transaction Detail - TestRun :7385 Transaction Name Min (sec) Avg (sec) Max (sec) Std Dev Attempted Success Failure (%) Completed (Per sec) TxIndexPageDemo1 0.5 0.999 1.5 0.288 19185 15.113 TxDemoJs1Page 0.998 1.499 0.289 TxIndexPageDemo2 1 19030 14.991 TxDemoJs2Page 1.005 1.996 2.983 0.409 100 ALL 1.247 0.538 76430 57400 24.899 45.217 Note: 100 % failure on DemoJs2 Page is for the group where JS Engine is OFF
14
Backup Slides
15
Demo_js_mixed.conf G_JAVA_SCRIPT Demo1 1 G_JAVA_SCRIPT Demo2 0 G_NEW_USER_ON_SESSION ALL 1 SGRP Demo1 NA Internet 0 js_demo SGRP Demo2 NA Internet 0 js_demo SCHEDULE ALL RU RAMP_UP ALL TIME 00:00:05 LINEARLY #SCHEDULE ALL Duration DURATION TIME 00:01:00 G_SESSION_PACING ALL G_PAGE_THINK_TIME ALL ALL G_HTTP_CACHING ALL AUTO_FETCH_EMBEDDED ALL ALL 1 #G_TRACING ALL SERVER_HOST :81 - TNAME Mixed Java Script Engine 2000 Users #G_DEBUG ALL 4 #G_MODULEMASK ALL HTTP CACHE # Last updated on Tue Feb 22 20:17:17 PST 2011
16
Demo_js1.conf G_JAVA_SCRIPT ALL 1 G_NEW_USER_ON_SESSION ALL 1 SGRP G NA Internet 0 js_demo1 2 TNAME 1 User 1 Session Test with Java Script Engine ON SCHEDULE ALL RU RAMP_UP ALL TIME 00:00:20 LINEARLY SCHEDULE ALL Duration DURATION SESSIONS 1 G_HTTP_CACHING ALL AUTO_FETCH_EMBEDDED ALL ALL 1 G_TRACING ALL G_MODULEMASK ALL HTTP CACHE G_DEBUG ALL 4 SERVER_HOST :81 - # Last updated on Tue Feb 22 20:17:17 PST 2011
17
Demo_js2.conf G_JAVA_SCRIPT ALL 1 G_NEW_USER_ON_SESSION ALL 1 SGRP G NA Internet 0 js_demo2 2 TNAME 1 User 1 Session Test with Java Script Engine ON SCHEDULE ALL RU RAMP_UP ALL TIME 00:00:20 LINEARLY SCHEDULE ALL Duration DURATION SESSIONS 1 G_HTTP_CACHING ALL AUTO_FETCH_EMBEDDED ALL ALL 1 G_TRACING ALL G_MODULEMASK ALL HTTP CACHE G_DEBUG ALL 4 SERVER_HOST :81 - # Last updated on Tue Feb 22 20:17:17 PST 2011
18
Index.html <html> <body> RESP_ORDER_NUMBER= ; RESP_RESERVATION_NUMBER= ; </body> </html>
19
Demo_js1.html (1/2) <html> <head> <script> function showDate(){ var cur_date = new Date(); document.getElementById('date').innerHTML = cur_date.toString(); } function updateLoadTag() { var loadTag1 = "Loadtag"; var dateFormatted = cur_date.getMonth() "/" + cur_date.getDate() + "/" + cur_date.getFullYear(); var loadTag2 = "is a cold day"; document.getElementById('loadtag').innerHTML = loadTag1 + " - " + dateFormatted + " " + loadTag2; function myOnloadFunction() updateLoadTag(); showDate(); </script> continue on next page …
20
Demo_js1.html (2/2) </head> <body onload="myOnloadFunction()"> <p >Current Date and Time is : <span id=date>none</span> </p> <p id=loadtag>Before Load</p> <p >Variable value is : <span id=var>none</span> </p> <script> var abc = 999; document.getElementById('var').innerHTML = abc; </script> </body> </html>
21
Demo_js2.html <html> <head> <script type="text/javascript" src="/JavaScript/demo_js2.js"></script> </head> <body onload="myOnloadFunction()"> <p >Current Date and Time is : <span id=date>none</span> </p> <p id=loadtag>Before Load</p> <p >Variable value is : <span id=var>none</span> </p> <script> var abc = 999; document.getElementById('var').innerHTML = abc; </script> </body> </html>
22
Demo_js2.js function showDate(){ var cur_date = new Date(); document.getElementById('date').innerHTML = cur_date.toString(); } function updateLoadTag() { var loadTag1 = "Loadtag"; var dateFormatted = cur_date.getMonth() "/" + cur_date.getDate() + "/" + cur_date.getFullYear(); var loadTag2 = "is a hot day"; document.getElementById('loadtag').innerHTML = loadTag1 + " - " + dateFormatted + " " + loadTag2; function myOnloadFunction() updateLoadTag(); showDate();
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.