functions.html
162 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- start the processing -->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../../docs/css/style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Apache JMeter - User's Manual: Functions and Variables</title>
<style>
.code { font-weight: bold; }
</style>
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76">
<table border="0" cellspacing="0">
<tr>
<td align="left">
<a href="http://www.apache.org"><img style="margin: 0px 30px 0px 0px" title="Apache Software Foundation" width="261" height="106" src="../../docs/images/asf-logo.png" border="0"/></a>
</td>
<td align="right">
<a href="http://jmeter.apache.org/"><img width="259" height="88" src="../../docs/images/jmeter.png" alt="Apache JMeter" title="Apache JMeter" border="0"/></a>
</td>
</tr>
</table>
<table border="0" cellspacing="4">
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td align="left" valign="top">
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="regular_expressions.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="properties_reference.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="functions"><strong>21. Functions and Variables</strong></a></font>
</td></tr>
<tr><td>
<blockquote>
<p>
JMeter functions are special values that can populate fields of any Sampler or other
element in a test tree. A function call looks like this:</p><p><tt class="code">${__functionName(var1,var2,var3)}</tt></p><p>
Where "__functionName" matches the name of a function.
<br>
Parentheses surround the parameters sent to the function, for example <tt class="code">${__time(YMD)}</tt>
The actual parameters vary from function to function.
Functions that require no parameters can leave off the parentheses, for example <tt class="code">${__threadNum}</tt>.
</p><p>
If a function parameter contains a comma, then be sure to escape this with "<tt class="code">\</tt>", otherwise JMeter will treat it as a parameter delimiter.
For example:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
${__time(EEE\, d MMM yyyy)}
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
If the comma is not escaped - e.g. <tt class="code">${__javaScript(Math.max(2,5))}</tt> - you will get an error such as:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
ERROR - jmeter.functions.JavaScript: Error processing Javascript: [Math.max(2]
org.mozilla.javascript.EvaluatorException: missing ) after argument list (<cmd>#1)
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
This is because the string "<tt class="code">Math.max(2,5)</tt>" is treated as being two parameters to the __javascript function:<br>
<tt class="code">Math.max(2</tt> and <tt class="code">5)</tt><br>
Other error messages are possible.
</p><p>Variables are referenced as follows:
<pre>
${VARIABLE}
</pre>
</p><p>
<b>
If an undefined function or variable is referenced, JMeter does not report/log an error - the reference is returned unchanged.
For example if <tt class="code">UNDEF</tt> is not defined as a variable, then the value of <tt class="code">${UNDEF}</tt> is <tt class="code">${UNDEF}</tt>.
</b>
Variables, functions (and properties) are all case-sensitive.
<b>
JMeter trims spaces from variable names before use, so for example
<tt class="code">${__Random(1,63, LOTTERY )}</tt> will use the variable '<tt class="code">LOTTERY</tt>' rather than '<tt class="code"> LOTTERY </tt>'.
</b>
</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
Properties are not the same as variables.
Variables are local to a thread; properties are common to all threads,
and need to be referenced using the <tt class="code">__P</tt> or <tt class="code">__property</tt> function.
</td></tr>
</table>
</p>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
When using <tt class="code">\</tt> before a variable for a windows path for example <tt class="code">C:\test\${test}</tt>, ensure you escape the <tt class="code">\</tt>
otherwise JMeter will not interpret the variable, example:
<tt class="code">C:\\test\\${test}</tt>.
<br>
Alternatively, just use <tt class="code">/</tt> instead for the path separator - e.g. <tt class="code">C:/test/${test}</tt> - Windows JVMs will convert the separators as necessary.
</td></tr>
</table>
</p>
<p>List of functions, loosely grouped into types.</p><table>
<tr>
<td bgcolor="#039acc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Type of function
</font>
</td>
<td bgcolor="#039acc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Name
</font>
</td>
<td bgcolor="#039acc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Comment
</font>
</td>
<td bgcolor="#039acc" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Since
</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Information</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__threadNum">threadNum</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
get thread number</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
1.X</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Information</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__samplerName">samplerName</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
get the sampler name (label)</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.5</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Information</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__machineIP">machineIP</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
get the local machine IP address</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.6</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Information</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__machineName">machineName</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
get the local machine name</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
1.X</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Information</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__time">time</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
return current time in various formats</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.2</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Information</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__log">log</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
log (or display) a message (and return the value)</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.2</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Information</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__logn">logn</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
log (or display) a message (empty return value)</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.2</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Input</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__StringFromFile">StringFromFile</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
read a line from a file</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
1.9</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Input</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__FileToString">FileToString</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
read an entire file</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.4</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Input</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__CSVRead">CSVRead</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
read from CSV delimited file</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
1.9</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Input</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__XPath">XPath</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Use an XPath expression to read from a file</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.0.3</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Calculation</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__counter">counter</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
generate an incrementing number</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
1.X</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Calculation</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__intSum">intSum</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
add int numbers</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
1.8.1</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Calculation</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__longSum">longSum</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
add long numbers</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.3.2</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Calculation</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__Random">Random</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
generate a random number</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
1.9</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Calculation</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__RandomFromMultipleVars">RandomFromMultipleVars</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
extracts an element from the values of a set of variables separated by <tt class="code">|</tt></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
3.1</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Calculation</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__RandomString">RandomString</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
generate a random string</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.6</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Calculation</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__UUID">UUID</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
generate a random type 4 UUID</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.9</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Scripting</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__groovy">groovy</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
run a Groovy script</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
3.1</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Scripting</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__BeanShell">BeanShell</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
run a BeanShell script</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
1.X</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Scripting</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__javaScript">javaScript</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
process JavaScript (Nashorn)</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
1.9</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Scripting</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__jexl2">jexl2</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
evaluate a Commons Jexl2 expression</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
jexl2(2.1.1)</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Scripting</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__jexl3">jexl3</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
evaluate a Commons Jexl3 expression</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
jexl3 (3.0)</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Properties</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__property">property</a> </font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
read a property</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.0</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Properties</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__P">P</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
read a property (shorthand method)</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.0</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Properties</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__setProperty">setProperty</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
set a JMeter property</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.1</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Variables</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__split">split</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Split a string into variables</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.0.2</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Variables</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__V">V</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
evaluate a variable name</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.3RC3</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Variables</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__eval">eval</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
evaluate a variable expression</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.3.1</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Variables</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__evalVar">evalVar</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
evaluate an expression stored in a variable</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.3.1</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
String</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__regexFunction">regexFunction</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
parse previous response using a regular expression</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
1.X</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
String</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__escapeOroRegexpChars">escapeOroRegexpChars</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
quote meta chars used by ORO regular expression</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.9</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
String</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__char">char</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
generate Unicode char values from a list of numbers</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.3.3</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
String</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__unescape">unescape</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Process strings containing Java escapes (e.g. \n & \t)</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.3.3</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
String</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__unescapeHtml">unescapeHtml</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Decode HTML-encoded strings</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.3.3</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
String</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__escapeHtml">escapeHtml</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Encode strings using HTML encoding</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.3.3</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
String</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__escapeXml">escapeXml</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Encode strings using XMl encoding</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
3.2</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
String</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__urldecode">urldecode</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Decode a application/x-www-form-urlencoded string</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.10</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
String</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__urlencode">urlencode</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Encode a string to a application/x-www-form-urlencoded string</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.10</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
String</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
<a href="#__TestPlanName">TestPlanName</a></font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Return name of current test plan</font>
</td>
<td bgcolor="#a0ddf0" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
2.6</font>
</td>
</tr>
</table>
<p></p><table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="what_can_do"><strong>21.1 What can functions do</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>There are two kinds of functions: user-defined static values (or variables), and built-in functions.<br>
User-defined static values allow the user to define variables to be replaced with their static value when
a test tree is compiled and submitted to be run. This replacement happens once at the beginning of the test
run. This could be used to replace the DOMAIN field of all HTTP requests, for example - making it a simple
matter to change a test to target a different server with the same test.
</p><p>
Note that variables cannot currently be nested; i.e. <tt class="code">${Var${N}}</tt> does not work.
The <tt class="code">__V</tt> (variable) function can be used to do this: <tt class="code">${__V(Var${N})}</tt>.
You can also use <tt class="code">${__BeanShell(vars.get("Var${N}")}</tt>.
</p><p>This type of replacement is possible without functions, but was less convenient and less intuitive.
It required users to create default config elements that would fill in blank values of Samplers.
Variables allow one to replace only part of any given value, not just filling in blank values.</p><p>
With built-in functions users can compute new values at run-time based on previous response data, which
thread the function is in, the time, and many other sources. These values are generated fresh for every
request throughout the course of the test. </p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>Functions are shared between threads.
Each occurrence of a function call in a test plan is handled by a separate function instance.</td></tr>
</table>
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="where"><strong>21.2 Where can functions and variables be used?</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
Functions and variables can be written into any field of any test component (apart from the TestPlan - see below).
Some fields do not allow random strings
because they are expecting numbers, and thus will not accept a function. However, most fields will allow
functions.
</p><p>
Functions which are used on the Test Plan have some restrictions.
JMeter thread variables will have not been fully set up when the functions are processed,
so variable names passed as parameters will not be set up, and variable references will not work,
so <tt class="code">split()</tt> and <tt class="code">regex()</tt> and the variable evaluation functions won't work.
The <tt class="code">threadNum()</tt> function won't work (and does not make sense at test plan level).
The following functions should work OK on the test plan:
<ul>
<li>intSum</li>
<li>longSum</li>
<li>machineName</li>
<li>BeanShell</li>
<li>groovy</li>
<li>javaScript</li>
<li>jexl2/jexl3</li>
<li>random</li>
<li>time</li>
<li>property functions</li>
<li>log functions</li>
</ul>
</p><p>
Configuration elements are processed by a separate thread.
Therefore functions such as <tt class="code">__threadNum</tt> do not work properly in elements such as User Defined Variables.
Also note that variables defined in a UDV element are not available until the element has been processed.
</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>When using variable/function references in SQL code (etc.),
remember to include any necessary quotes for text strings,
i.e. use
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
SELECT item from table where name='${VAR}'
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
<b>not</b>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
SELECT item from table where name=${VAR}
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
(unless <tt class="code">VAR</tt> itself contains the quotes)
</td></tr>
</table>
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="how"><strong>21.3 How to reference variables and functions</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>Referencing a variable in a test element is done by bracketing the variable name with '<tt class="code">${</tt>' and '<tt class="code">}</tt>'.</p><p>Functions are referenced in the same manner, but by convention, the names of
functions begin with "<tt class="code">__</tt>" to avoid conflict with user value names<sup>*</sup>. Some functions take arguments to
configure them, and these go in parentheses, comma-delimited. If the function takes no arguments, the parentheses can
be omitted.</p><p><b>Argument values that themselves contain commas should be escaped as necessary.
If you need to include a comma in your parameter value, escape it like so: '<tt class="code">\,</tt>'.</b>
This applies for example to the scripting functions - Javascript, Beanshell, Jexl, groovy - where it is necessary to escape any commas
that may be needed in script method calls - e.g.
</p><pre>
${__BeanShell(vars.put("name"\,"value"))}
</pre><p>
Alternatively, you can define your script as a variable, e.g. on the Test Plan:
<pre>SCRIPT vars.put("name","value")</pre>
The script can then be referenced as follows:
<pre>${__BeanShell(${SCRIPT})}</pre>
There is no need to escape commas in the <tt class="code">SCRIPT</tt> variable because the function call is parsed before the variable is replaced with its value.
This works well in conjunction with the JSR223 or BeanShell Samplers, as these can be used to test Javascript, Jexl and BeanShell scripts.
</p><p>
Functions can reference variables and other functions, for example
<tt class="code">${__XPath(${__P(xpath.file),${XPATH})}</tt>
will use the property "<tt class="code">xpath.file</tt>" as the file name
and the contents of the variable <tt class="code">XPATH</tt> as the expression to search for.
</p><p>
JMeter provides a tool to help you construct
function calls for various built-in functions, which you can then copy-paste.
It will not automatically escape values for you, since functions can be parameters to other functions, and you should only escape values you intend as literal.
</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
If a string contains a backslash('<tt class="code">\</tt>') and also contains a function or variable reference, the backslash will be removed if
it appears before '<tt class="code">$</tt>' or '<tt class="code">,</tt>' or '<tt class="code">\</tt>'.
This behaviour is necessary to allow for nested functions that include commas or the string <tt class="code">${</tt>.
Backslashes before '<tt class="code">$</tt>' or '<tt class="code">,</tt>' or '<tt class="code">\</tt>' are not removed if the string does not contain a function or variable reference.
</td></tr>
</table>
</p>
<p>
<b>The value of a variable or function can be reported</b> using the <a href="#__logn"><tt class="code">__logn()</tt></a> function.
The <tt class="code">__logn()</tt> function reference can be used anywhere in the test plan after the variable has been defined.
Alternatively, the Java Request sampler can be used to create a sample containing variable references;
the output will be shown in the appropriate Listener.
Note there is a <a href="../usermanual/component_reference.html#Debug_Sampler">Debug Sampler</a>
that can be used to display the values of variables etc. in the Tree View Listener.
</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td><sup>*</sup>If you define a user-defined static variable with the same name as a built-in function, your static
variable will override the built-in function.</td></tr>
</table>
</p>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="function_helper"><strong>21.4 The Function Helper Dialog</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>The Function Helper dialog is available from JMeter's Tools menu.</p><table border="0" cellspacing="0" cellpadding="0"><tr><td><img width='831' height='305' src="../../docs/images/screenshots/function_helper_dialog.png"/><br>
<font size="-1">Function Helper Dialog</font></td></tr></table>
<p>Using the Function Helper, you can select a function from the pull down, and assign
values for its arguments. The left column in the table provides a brief description of the
argument, and the right column is where you write in the value for that argument. Different
functions take different arguments.</p><p>Once you have done this, click the "generate" button, and the appropriate string is generated
for you to copy-paste into your test plan wherever you like.</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="functions"><strong>21.5 Functions</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__regexFunction">21.5.1 __regexFunction</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The Regex Function is used to parse the previous response (or the value of a variable) using any regular
expression (provided by user). The function returns the template string with variable values filled
in.</p>
<p>The <tt class="code">__regexFunction</tt> can also store values for future use. In the sixth parameter, you can specify
a reference name. After this function executes, the same values can be retrieved at later times
using the syntax for user-defined values. For instance, if you enter "<tt class="code">refName</tt>" as the sixth
parameter you will be able to use:
<ul>
<li><tt class="code">${refName}</tt> to refer to the computed result of the second parameter ("Template for the
replacement string") parsed by this function</li>
<li><tt class="code">${refName_g0}</tt> to refer to the entire match parsed by this function.</li>
<li><tt class="code">${refName_g1}</tt> to refer to the first group parsed by this function.</li>
<li><tt class="code">${refName_g#}</tt> to refer to the n<sup>th</sup> group parsed by this function.</li>
<li><tt class="code">${refName_matchNr}</tt> to refer to the number of groups found by this function.</li>
</ul>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>If using distributed testing, ensure you switch mode (see <tt class="code">jmeter.properties</tt>) so that it's not a stripping one, see <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=56376">Bug 56376</a>
</td></tr>
</table>
</p>
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>First argument</td>
<td>The first argument is the regular expression
to be applied to the response data. It will grab all matches. Any parts of this expression
that you wish to use in your template string, be sure to surround in parentheses. Example:
<tt class="code"><a href="(.*)"></tt>. This will grab the value of the link and store it as the first group (there is
only 1 group). Another example: <tt class="code"><input type="hidden" name="(.*)" value="(.*)"></tt>. This will
grab the name as the first group, and the value as the second group. These values can be used
in your template string</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Second argument</td>
<td>This is the template string that will replace
the function at run-time. To refer to a group captured in the regular expression, use the syntax:
<tt class="code">$[group_number]$</tt>. I.e.: <tt class="code">$1$</tt>, or <tt class="code">$2$</tt>. Your template can be any string.</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Third argument</td>
<td>The third argument tells JMeter which match
to use. Your regular expression might find numerous matches. You have four choices:
<ul><li>An integer - Tells JMeter to use that match. '<tt class="code">1</tt>' for the first found match, '<tt class="code">2</tt>' for the
second, and so on</li>
<li><tt class="code">RAND</tt> - Tells JMeter to choose a match at random.</li>
<li><tt class="code">ALL</tt> - Tells JMeter to use all matches, and create a template string for each one and then
append them all together. This option is little used.</li>
<li>A float number between 0 and 1 - tells JMeter to find the X<sup>th</sup> match using the formula:
(number_of_matches_found * float_number) rounded to nearest integer.</li>
</ul></td>
<td>
No, default=1
</td>
</tr>
<tr>
<td>Fourth argument</td>
<td>If '<tt class="code">ALL</tt>' was selected for the above argument
value, then this argument will be inserted between each appended copy of the template value.</td>
<td>
No
</td>
</tr>
<tr>
<td>Fifth argument</td>
<td>Default value returned if no match is found</td>
<td>
No
</td>
</tr>
<tr>
<td>Sixth argument</td>
<td>A reference name for reusing the values parsed by this function.<br>
Stored values are <tt class="code">${refName}</tt> (the replacement template string) and <tt class="code">${refName_g#}</tt> where "<tt class="code">#</tt>" is the
group number from the regular expression ("<tt class="code">0</tt>" can be used to refer to the entire match).</td>
<td>
No
</td>
</tr>
<tr>
<td>Seventh argument</td>
<td>Input variable name.
If specified, then the value of the variable is used as the input instead of using the previous sample result.
</td>
<td>
No
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__counter">21.5.2 __counter</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The counter generates a new number each time it is called, starting with 1
and incrementing by +1 each time. The counter can be configured to keep each simulated user's values
separate, or to use the same counter for all users. If each user's values is incremented separately,
that is like counting the number of iterations through the test plan. A global counter is like
counting how many times that request was run.
</p>
<p>The counter uses an integer variable to hold the count, which therefore has a maximum of 2,147,483,647.</p>
<p>The counter function instances are completely independent.
The global counter - "<tt class="code">FALSE</tt>" - is separately maintained by each counter instance.
</p>
<p>
<b>
Multiple <tt class="code">__counter</tt> function calls in the same iteration won't increment the value further.
</b>
<br>
If you want to have a count that increments for each sample, use the function in a Pre-Processor such as <a href="../usermanual/component_reference.html#User_Parameters">User Parameters</a>.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>First argument</td>
<td><tt class="code">TRUE</tt> if you wish each simulated user's counter
to be kept independent and separate from the other users. <tt class="code">FALSE</tt> for a global counter.</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Second argument</td>
<td>A reference name for reusing the value created by this function.<br>
Stored values are of the form <tt class="code">${refName}</tt>. This allows you to keep one counter and refer to its value in
multiple places.</td>
<td>
No
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__threadNum">21.5.3 __threadNum</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The thread number function simply returns the number of the thread currently
being executed. These numbers are independent of ThreadGroup, meaning thread #1 in one threadgroup
is indistinguishable from thread #1 in another threadgroup, from the point of view of this function.</p>
<p>There are no arguments for this function.</p>
<p>Usage Example:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__threadNum}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
returns a number between 1 and the max number of running threads configured in the containing Thread Group
</p>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
This function does not work in any Configuration elements (e.g. User Defined Variables) as these are run from a separate thread.
Nor does it make sense to use it on the Test Plan.
</td></tr>
</table>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__intSum">21.5.4a __intSum</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The intSum function can be used to compute the sum of two or more integer values.
</p>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
The reference name is optional, but it must not be a valid integer.
</td></tr>
</table>
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>First argument</td>
<td>The first int value.</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Second argument</td>
<td>The second int value.</td>
<td>
Yes
</td>
</tr>
<tr>
<td>nth argument</td>
<td>The n<sup>th</sup> int value.</td>
<td>
No
</td>
</tr>
<tr>
<td>last argument</td>
<td>A reference name for reusing the value computed by this function.
If specified, the reference name must contain at least one non-numeric character otherwise it will
be treated as another int value to be added.
</td>
<td>
No
</td>
</tr>
</table>
<p>Examples:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__intSum(2,5,MYVAR)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return 7 (2+5) and store the result in MYVAR variable. So <tt class="code">${MYVAR}</tt> will be equal to 7. <br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__intSum(2,5,7)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return 14 (2+5+7) and store the result in MYVAR variable. <br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__intSum(1,2,5,${MYVAR})}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return 16 if MYVAR value is equal to 8, 1+2+5+${MYVAR})<br>
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__longSum">21.5.4b __longSum</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The longSum function can be used to compute the sum of two or more long values, use this instead of __intSum whenever you know your values will not
be in the interval -2147483648 to 2147483647.
</p><p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>First argument</td>
<td>The first long value.</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Second argument</td>
<td>The second long value.</td>
<td>
Yes
</td>
</tr>
<tr>
<td>nth argument</td>
<td>The n<sup>th</sup> long value.</td>
<td>
No
</td>
</tr>
<tr>
<td>last argument</td>
<td>A reference name for reusing the value computed by this function.
If specified, the reference name must contain at least one non-numeric character otherwise it will
be treated as another long value to be added.
</td>
<td>
No
</td>
</tr>
</table>
<p>Examples:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__longSum(2,5,MYVAR)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return 7 (2+5) and store the result in MYVAR variable. So <tt class="code">${MYVAR}</tt> will be equal to 7. <br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__longSum(2,5,7)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return 14 (2+5+7) and store the result in MYVAR variable. <br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__longSum(1,2,5,${MYVAR})}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return 16 if MYVAR value is equal to 8, 1+2+5+${MYVAR})<br>
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<a name="_StringFromFile"></a><table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__StringFromFile">21.5.5 __StringFromFile</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The StringFromFile function can be used to read strings from a text file.
This is useful for running tests that require lots of variable data.
For example when testing a banking application, 100s or 1000s of different account numbers might be required.
</p>
<p>
See also the
<a href="component_reference.html#CSV_Data_Set_Config">CSV Data Set Config test element</a>
which may be easier to use. However, that does not currently support multiple input files.
</p>
<p>
Each time it is called it reads the next line from the file.
All threads share the same instance, so different threads will get different lines.
When the end of the file is reached, it will start reading again from the beginning,
unless the maximum loop count has been reached.
If there are multiple references to the function in a test script, each will open the file independently,
even if the file names are the same.
[If the value is to be used again elsewhere, use different variable names for each function call.]
</p>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
Function instances are shared between threads, and the file is (re-)opened by whatever thread
happens to need the next line of input, so using the <tt class="code">threadNumber</tt> as part of the file name
will result in unpredictable behaviour.
</td></tr>
</table>
</p>
<p>If an error occurs opening or reading the file, then the function returns the string "<tt class="code">**ERR**</tt>"</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>File Name</td>
<td>Path to the file name.
(The path can be relative to the JMeter launch directory)
If using optional sequence numbers, the path name should be suitable for passing to DecimalFormat.
See below for examples.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Variable Name</td>
<td>
A reference name - <tt class="code">refName</tt> - for reusing the value created by this function. Stored values are of the form <tt class="code">${refName}</tt>.
Defaults to "<tt class="code">StringFromFile_</tt>".
</td>
<td>
No
</td>
</tr>
<tr>
<td>Start sequence number</td>
<td>Initial Sequence number (if omitted, the End sequence number is treated as a loop count)</td>
<td>
No
</td>
</tr>
<tr>
<td>End sequence number</td>
<td>Final sequence number (if omitted, sequence numbers can increase without limit)</td>
<td>
No
</td>
</tr>
</table>
<p>The file name parameter is resolved when the file is opened or re-opened.</p><p>The reference name parameter (if supplied) is resolved every time the function is executed.</p><p><b>Using sequence numbers:</b></p><p>When using the optional sequence numbers, the path name is used as the format string for <tt class="code">java.text.DecimalFormat</tt>.
The current sequence number is passed in as the only parameter.
If the optional start number is not specified, the path name is used as is.
Useful formatting sequences are:
</p><dl>
<dt><tt class="code">#</tt></dt><dd>insert the number, with no leading zeros or spaces</dd>
<dt><tt class="code">000</tt></dt><dd>insert the number packed out to three digits with leading zeros if necessary</dd>
</dl><a name="string-from-file-format-examples"/>
<p><b>Usage of format strings</b></p>
Here are a few format strings and the corresponding sequences they will generate.
<dl>
<dt><tt class="code">pin#'.'dat</tt></dt><dd>Will generate the digits without leading zeros and treat the dot literally like<br>
<tt class="code">pin1.dat</tt>, …, <tt class="code">pin9.dat</tt>, <tt class="code">pin10.dat</tt>, …, <tt class="code">pin9999.dat</tt></dd>
<dt><tt class="code">pin000'.'dat</tt></dt><dd>Will generate leading zeros while keeping the dot. When the numbers start having more digits
then those three digits that this format suggests, the sequence will use more digits as can be seen in<br>
<tt class="code">pin001.dat</tt>, … <tt class="code">pin099.dat</tt>, …, <tt class="code">pin999.dat</tt>, …, <tt class="code">pin9999.dat</tt></dd>
<dt><tt class="code">pin'.'dat#</tt></dt><dd>Will append digits without leading zeros while keeping the dot and generate<br>
<tt class="code">pin.dat1</tt>, …, <tt class="code">pin.dat9</tt>, …, <tt class="code">pin.dat999</tt></dd>
</dl>
<p>
If more digits are required than there are formatting characters, the number will be
expanded as necessary.<br>
<b>To prevent a formatting character from being interpreted,
enclose it in single quotes. Note that "<tt class="code">.</tt>" is a formatting character,
and must be enclosed in single quotes</b>
(though <tt class="code">#.</tt> and <tt class="code">000.</tt> work as expected in locales where the decimal point is also "<tt class="code">.</tt>")
<br>
In other locales (e.g. <tt class="code">fr</tt>), the decimal point is "<tt class="code">,</tt>" - which means that "<tt class="code">#.</tt>"
becomes "<tt class="code">nnn,</tt>".<br>
See the documentation for <tt class="code">DecimalFormat</tt> for full details.<br>
If the path name does not contain any special formatting characters,
the current sequence number will be appended to the name, otherwise
the number will be inserted according to the formatting instructions.<br>
If the start sequence number is omitted, and the end sequence number is specified,
the sequence number is interpreted as a loop count, and the file will be used at most "<tt class="code">end</tt>" times.
In this case the filename is not formatted.
<br>
<tt class="code">${_StringFromFile(PIN#'.'DAT,,1,2)}</tt> - reads <tt class="code">PIN1.DAT</tt>, <tt class="code">PIN2.DAT</tt><br>
<tt class="code">${_StringFromFile(PIN.DAT,,,2)}</tt> - reads <tt class="code">PIN.DAT</tt> twice<br>
Note that the "<tt class="code">.</tt>" in <tt class="code">PIN.DAT</tt> above should <u>not</u> be quoted.
In this case the start number is omitted, so the file name is used exactly as is.
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__machineName">21.5.6a __machineName</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The machineName function returns the local host name. This uses the Java method <tt class="code">InetAddress.getLocalHost()</tt> and passes it to <tt class="code">getHostName()</tt></p><p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Variable Name</td>
<td>A reference name for reusing the value
computed by this function.</td>
<td>
No
</td>
</tr>
</table>
<p>Examples:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__machineName()}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return the host name of the machine<br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__machineName}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return the host name of the machine<br>
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__machineIP">21.5.6b __machineIP</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The machineIP function returns the local IP address. This uses the Java method <tt class="code">InetAddress.getLocalHost()</tt> and passes it to <tt class="code">getHostAddress()</tt></p><p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Variable Name</td>
<td>A reference name for reusing the value
computed by this function.</td>
<td>
No
</td>
</tr>
</table>
<p>Examples:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__machineIP()}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return the IP address of the machine<br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__machineIP}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return the IP address of the machine<br>
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__javaScript">21.5.7 __javaScript</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The javaScript function executes a piece of JavaScript (not Java!) code and returns its value
</p>
<p>
The JMeter Javascript function calls a standalone JavaScript interpreter.
Javascript is used as a scripting language, so you can do calculations etc.</p>
<p>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>javaScript is not the best scripting language for performances in JMeter. If your plan requires a high number of threads
it is advised to use <tt class="code">__jexl3</tt> or <tt class="code">__groovy</tt> functions.
</td></tr>
</table>
</p>
For Nashorn Engine, please see <a href="https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/">Java Platform, Standard Edition Nashorn User's Guide</a>.<br>
For Rhino engine, please see <a href="http://www.mozilla.org/rhino/overview.html">Mozilla Rhino Overview</a>
</p>
<p>
The following variables are made available to the script:
</p>
<ul>
<li><tt class="code">log</tt> - the <a href="https://www.slf4j.org/api/org/slf4j/Logger.html">Logger</a> for the function</li>
<li><tt class="code">ctx</tt> - <a href="../api/org/apache/jmeter/threads/JMeterContext.html">JMeterContext</a> object</li>
<li><tt class="code">vars</tt> - <a href="../api/org/apache/jmeter/threads/JMeterVariables.html">JMeterVariables</a> object</li>
<li><tt class="code">threadName</tt> - String containing the current thread name</li>
<li><tt class="code">sampler</tt> - current <a href="../api/org/apache/jmeter/samplers/Sampler.html">Sampler</a> object (if any)</li>
<li><tt class="code">sampleResult</tt> - previous <a href="../api/org/apache/jmeter/samplers/SampleResult.html">SampleResult</a> object (if any)</li>
<li><tt class="code">props</tt> - JMeterProperties (class <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html"><tt class="code">java.util.Properties</tt></a>) object</li>
</ul>
<p>
Rhinoscript allows access to static methods via its Packages object.
See the <a href="https://wiki.openjdk.java.net/display/Nashorn/Rhino+Migration+Guide">Scripting Java</a> documentation.
For example one can access the JMeterContextService static methods thus:
<tt class="code">Java.type("org.apache.jmeter.threads.JMeterContextService").getTotalThreads()</tt>
</p>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
JMeter is not a browser, and does not interpret the JavaScript in downloaded pages.
</td></tr>
</table>
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Expression</td>
<td>The JavaScript expression to be executed. For example:
<ul>
<li><tt class="code">new Date()</tt> - return the current date and time</li>
<li><tt class="code">Math.floor(Math.random()*(${maxRandom}+1))</tt>
- a random number between <tt class="code">0</tt> and the variable <tt class="code">maxRandom</tt></li>
<li><tt class="code">${minRandom}+Math.floor(Math.random()*(${maxRandom}-${minRandom}+1))</tt>
- a random number between the variables <tt class="code">minRandom</tt> and <tt class="code">maxRandom</tt></li>
<li><tt class="code">"${VAR}"=="abcd"</tt></li>
</ul>
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Variable Name</td>
<td>A reference name for reusing the value
computed by this function.</td>
<td>
No
</td>
</tr>
</table>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>Remember to include any necessary quotes for text strings and JMeter variables. Also, if
the expression has commas, please make sure to escape them. For example in:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
${__javaScript('${sp}'.slice(7\,99999))}
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
the comma after <tt class="code">7</tt> is escaped.</td></tr>
</table>
</p>
<p>Examples:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__javaScript(new Date())}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return <tt class="code">Sat Jan 09 2016 16:22:15 GMT+0100 (CET)</tt><br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__javaScript(new Date(),MYDATE)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return <tt class="code">Sat Jan 09 2016 16:22:15 GMT+0100 (CET)</tt> and store it under variable <tt class="code">MYDATE</tt><br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__javaScript(Math.floor(Math.random()*(${maxRandom}+1)),MYRESULT)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will use maxRandom variable, return a random value between 0 and maxRandom and store it in MYRESULT
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__javaScript(${minRandom}+Math.floor(Math.random()*(${maxRandom}-${minRandom}+1)),MYRESULT)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will use <tt class="code">maxRandom</tt> and <tt class="code">minRandom</tt> variables, return a random value between <tt class="code">maxRandom</tt> and <tt class="code">minRandom</tt> and store it under variable <tt class="code">MYRESULT</tt>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__javaScript("${VAR}"=="abcd",MYRESULT)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will compare the value of <tt class="code">VAR</tt> variable with <tt class="code">abcd</tt>, return <tt class="code">true</tt> or <tt class="code">false</tt> and store the result in MYRESULT
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__Random">21.5.8 __Random</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The random function returns a random number that lies between the given min and max values.</p><p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Minimum value</td>
<td>A number</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Maximum value</td>
<td>A bigger number</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Variable Name</td>
<td>A reference name for reusing the value
computed by this function.</td>
<td>
No
</td>
</tr>
</table>
<p>Examples:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__Random(0,10)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return a random number between 0 and 10<br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__Random(0,10, MYVAR)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return a random number between 0 and 10 and store it in <tt class="code">MYVAR</tt>. <tt class="code">${MYVAR}</tt> will contain the random number<br>
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__RandomString">21.5.8 __RandomString</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The RandomString function returns a random String of length using characters in chars to use.</p><p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Length</td>
<td>A number length of generated String</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Characters to use</td>
<td>Chars used to generate String</td>
<td>
No
</td>
</tr>
<tr>
<td>Variable Name</td>
<td>A reference name for reusing the value
computed by this function.</td>
<td>
No
</td>
</tr>
</table>
<p>Examples:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__RandomString(5)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return a random string of 5 characters which can be readable or not<br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__RandomString(10,abcdefg)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return a random string of 10 characters picked from <tt class="code">abcdefg</tt> set, like <tt class="code">cdbgdbeebd</tt> or <tt class="code">adbfeggfad</tt>, …<br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__RandomString(6,a12zeczclk, MYVAR)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return a random string of 6 characters picked from <tt class="code">a12zeczclk</tt> set and store the result in <tt class="code">MYVAR</tt>, <tt class="code">MYVAR</tt> will contain
string like <tt class="code">2z22ak</tt> or <tt class="code">z11kce</tt>, …<br>
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__RandomFromMultipleVars">21.5.8 __RandomFromMultipleVars</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The RandomFromMultipleVars function returns a random value based on the variable values provided by <tt class="code">Source Variables</tt>.</p>
The variables can be simple or multi-valued as they can be generated by the following extractors:
<ul>
<li><a href="component_reference.html#Regular_Expression_Extractor">Regular Expression Extractor</a></li>
<li><a href="component_reference.html#CSS/JQuery_Extractor">CSS/JQuery Extractor</a></li>
<li><a href="component_reference.html#JSON_Extractor">JSON Extractor</a></li>
<li><a href="component_reference.html#XPath_Assertion">XPath Assertion</a></li>
</ul>
Multi-value vars are the ones that are extracted when you set <tt class="code">-1</tt> for <tt class="code">Match Numbers</tt>.
This leads to creation of match number variable called <tt class="code">varName_matchNr</tt> and for each value to the creation of variable <tt class="code">varName_n</tt> where n = 1, 2, 3 etc.
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Source Variables</td>
<td>Variable names separated by <tt class="code">|</tt> that contain the values that will be used as input for random computation</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Variable Name</td>
<td>A reference name for reusing the value
computed by this function.</td>
<td>
No
</td>
</tr>
</table>
<p>Examples:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__RandomFromMultipleVars(val)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return a random string based on content of variable val taking into account wether they are multi-value or not<br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__RandomFromMultipleVars(val1|val2)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return a random string based on content of variables val1 and val2 taking into account wether they are multi-value or not<br>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__RandomFromMultipleVars(val1|val2, MYVAR)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return a random string based on content of variables val1 and val2 taking into account wether they are multi-value or not and store the result in <tt class="code">MYVAR</tt><br>
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__UUID">21.5.8 __UUID</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The UUID function returns a pseudo random type 4 Universally Unique IDentifier (UUID).</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
</table>
<p>Examples:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${UUID()}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return UUIDs with this format : <tt class="code">c69e0dd1-ac6b-4f2b-8d59-5d4e8743eecd</tt> <br>
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__CSVRead">21.5.8 __CSVRead</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The CSVRead function returns a string from a CSV file (c.f. <a href="#_StringFromFile">StringFromFile</a>)</p>
<p>NOTE: JMeter supports multiple file names.
</p>
<p><b>In most cases, the newer
<a href="component_reference.html#CSV_Data_Set_Config">CSV Data Set Config element</a>
is easier to use.</b></p>
<p>
When a filename is first encountered, the file is opened and read into an internal
array. If a blank line is detected, this is treated as end of file - this allows
trailing comments to be used.
</p>
<p>All subsequent references to the same file name use the same internal array.
N.B. the filename case is significant to the function, even if the OS doesn't care,
so <tt class="code">CSVRead(abc.txt,0)</tt> and <tt class="code">CSVRead(aBc.txt,0)</tt> would refer to different internal arrays.
</p>
<p>
The <tt class="code">*ALIAS</tt> feature allows the same file to be opened more than once,
and also allows for shorter file names.
</p>
<p>
Each thread has its own internal pointer to its current row in the file array.
When a thread first refers to the file it will be allocated the next free row in
the array, so each thread will access a different row from all other threads.
[Unless there are more threads than there are rows in the array.]
</p>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>The function splits the line at every comma by default.
If you want to enter columns containing commas, then you will need
to change the delimiter to a character that does not appear in any
column data, by setting the property: <tt class="code">csvread.delimiter</tt>
</td></tr>
</table>
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>File Name</td>
<td>The file (or <tt class="code">*ALIAS</tt>) to read from</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Column number</td>
<td>
The column number in the file.
<tt class="code">0</tt> = first column, <tt class="code">1</tt> = second etc.
"<tt class="code">next</tt>" - go to next line of file.
<tt class="code">*ALIAS</tt> - open a file and assign it to the alias
</td>
<td>
Yes
</td>
</tr>
</table>
<p>For example, you could set up some variables as follows:
<ul>
<li>COL1a <tt class="code">${__CSVRead(random.txt,0)}</tt></li>
<li>COL2a <tt class="code">${__CSVRead(random.txt,1)}${__CSVRead(random.txt,next)}</tt></li>
<li>COL1b <tt class="code">${__CSVRead(random.txt,0)}</tt></li>
<li>COL2b <tt class="code">${__CSVRead(random.txt,1)}${__CSVRead(random.txt,next)}</tt></li>
</ul>
This would read two columns from one line, and two columns from the next available line.
If all the variables are defined on the same User Parameters Pre-Processor, then the lines
will be consecutive. Otherwise, a different thread may grab the next line.
</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
The function is not suitable for use with large files, as the entire file is stored in memory.
For larger files, use <a href="component_reference.html#CSV_Data_Set_Config">CSV Data Set Config element</a>
or <a href="#__StringFromFile">StringFromFile</a>.
</td></tr>
</table>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__property">21.5.9 __property</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The property function returns the value of a JMeter property.
If the property value cannot be found, and no default has been supplied, it returns the property name.
When supplying a default value, there is no need to provide a function name - the parameter can be set to null, and it will be ignored.
</p>For example:<p>
<ul>
<li><tt class="code">${__property(user.dir)}</tt> - return value of <tt class="code">user.dir</tt></li>
<li><tt class="code">${__property(user.dir,UDIR)}</tt> - return value of <tt class="code">user.dir</tt> and save in <tt class="code">UDIR</tt></li>
<li><tt class="code">${__property(abcd,ABCD,atod)}</tt> - return value of property <tt class="code">abcd</tt> (or "<tt class="code">atod</tt>" if not defined) and save in <tt class="code">ABCD</tt></li>
<li><tt class="code">${__property(abcd,,atod)}</tt> - return value of property <tt class="code">abcd</tt> (or "<tt class="code">atod</tt>" if not defined) but don't save it</li>
</ul>
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Property Name</td>
<td>The property name to be retrieved.</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Variable Name</td>
<td>A reference name for reusing the value
computed by this function.</td>
<td>
No
</td>
</tr>
<tr>
<td>Default Value</td>
<td>The default value for the property.</td>
<td>
No
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__P">21.5.10 __P</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>This is a simplified property function which is
intended for use with properties defined on the command line.
Unlike the <tt class="code">__property</tt> function, there is no option to save the value in a variable,
and if no default value is supplied, it is assumed to be 1.
The value of 1 was chosen because it is valid for common test variables such
as loops, thread count, ramp up etc.
</p>For example:<p>
<tt class="code">
Define the property value:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
jmeter -Jgroup1.threads=7 -Jhostname1=www.realhost.edu
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
Fetch the values:
<br>
<tt class="code">${__P(group1.threads)}</tt> - return the value of <tt class="code">group1.threads</tt>
<br>
<tt class="code">${__P(group1.loops)}</tt> - return the value of <tt class="code">group1.loops</tt>
<br>
<tt class="code">${__P(hostname,www.dummy.org)}</tt> - return value of property <tt class="code">hostname</tt> or <tt class="code">www.dummy.org</tt> if not defined
<br>
</tt>
In the examples above, the first function call would return <tt class="code">7</tt>,
the second would return <tt class="code">1</tt> and the last would return <tt class="code">www.dummy.org</tt>
(unless those properties were defined elsewhere!)
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Property Name</td>
<td>The property name to be retrieved.</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Default Value</td>
<td>The default value for the property.
If omitted, the default is set to "<tt class="code">1</tt>".</td>
<td>
No
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__log">21.5.11 __log</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The log function logs a message, and returns its input string
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>String to be logged</td>
<td>A string</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Log Level</td>
<td><tt class="code">OUT</tt>, <tt class="code">ERR</tt>, <tt class="code">DEBUG</tt>, <tt class="code">INFO</tt> (default), <tt class="code">WARN</tt> or <tt class="code">ERROR</tt></td>
<td>
No
</td>
</tr>
<tr>
<td>Throwable text</td>
<td>If non-empty, creates a Throwable to pass to the logger</td>
<td>
No
</td>
</tr>
<tr>
<td>Comment</td>
<td>If present, it is displayed in the string.
Useful for identifying what is being logged.</td>
<td>
No
</td>
</tr>
</table>
<p>The <tt class="code">OUT</tt> and <tt class="code">ERR</tt> log level names are used to direct the output to <tt class="code">System.out</tt> and <tt class="code">System.err</tt> respectively.
In this case, the output is always printed - it does not depend on the current log setting.
</p><dl>
<dt><tt class="code">${__log(Message)}</tt></dt><dd>written to the log file as "<tt class="code"> … thread Name : Message</tt>"</dd>
<dt><tt class="code">${__log(Message,OUT)}</tt></dt><dd>written to console window</dd>
<dt><tt class="code">${__log(${VAR},,,VAR=)}</tt></dt><dd>written to log file as "<tt class="code"> … thread Name VAR=value</tt>"</dd>
</dl></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__logn">21.5.12 __logn</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The logn function logs a message, and returns the empty string
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>String to be logged</td>
<td>A string</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Log Level</td>
<td><tt class="code">OUT</tt>, <tt class="code">ERR</tt>, <tt class="code">DEBUG</tt>, <tt class="code">INFO</tt> (default), <tt class="code">WARN</tt> or <tt class="code">ERROR</tt></td>
<td>
No
</td>
</tr>
<tr>
<td>Throwable text</td>
<td>If non-empty, creates a Throwable to pass to the logger</td>
<td>
No
</td>
</tr>
</table>
<p>The <tt class="code">OUT</tt> and <tt class="code">ERR</tt> log level names are used to direct the output to <tt class="code">System.out</tt> and <tt class="code">System.err</tt> respectively.
In this case, the output is always printed - it does not depend on the current log setting.
</p><dl>
<dt><tt class="code">${__logn(VAR1=${VAR1},OUT)}</tt></dt><dd>write the value of the variable to the console window</dd>
</dl></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__BeanShell">21.5.13 __BeanShell</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The BeanShell function evaluates the script passed to it, and returns the result.
</p>
<p>
<b>For full details on using BeanShell, please see the BeanShell web-site at <a href="http://www.beanshell.org/">http://www.beanshell.org/</a>
</b>
</p>
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
Note that a different Interpreter is used for each independent occurrence of the function
in a test script, but the same Interpreter is used for subsequent invocations.
This means that variables persist across calls to the function.
</td></tr>
</table>
</p>
<p>
A single instance of a function may be called from multiple threads.
However the function <tt class="code">execute()</tt> method is synchronised.
</p>
<p>
If the property "<tt class="code">beanshell.function.init</tt>" is defined, it is passed to the Interpreter
as the name of a sourced file. This can be used to define common methods and variables. There is a
sample init file in the bin directory: <tt class="code">BeanShellFunction.bshrc</tt>.
</p>
<p>
The following variables are set before the script is executed:
<ul>
<li><tt class="code">log</tt> - the <a href="https://www.slf4j.org/api/org/slf4j/Logger.html">Logger</a> for the BeanShell function (*)</li>
<li><tt class="code">ctx</tt> - <a href="../api/org/apache/jmeter/threads/JMeterContext.html">JMeterContext</a> object</li>
<li><tt class="code">vars</tt> - <a href="../api/org/apache/jmeter/threads/JMeterVariables.html">JMeterVariables</a> object</li>
<li><tt class="code">props</tt> - JMeterProperties (class <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html"><tt class="code">java.util.Properties</tt></a>) object</li>
<li><tt class="code">threadName</tt> - the threadName (String)</li>
<li><tt class="code">Sampler</tt> - the current <a href="../api/org/apache/jmeter/samplers/Sampler.html">Sampler</a>, if any</li>
<li><tt class="code">SampleResult</tt> - the current <a href="../api/org/apache/jmeter/samplers/SampleResult.html">SampleResult</a>, if any</li>
</ul>
(*) means that this is set before the init file, if any, is processed.
Other variables vary from invocation to invocation.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>BeanShell script</td>
<td>A beanshell script (not a file name)</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Name of variable</td>
<td>A reference name for reusing the value
computed by this function.</td>
<td>
No
</td>
</tr>
</table>
<p>
Example:
<dl>
<dt><tt class="code">${__BeanShell(123*456)}</tt></dt><dd>returns <tt class="code">56088</tt></dd>
<dt><tt class="code">${__BeanShell(source("function.bsh"))}</tt></dt><dd>processes the script in <tt class="code">function.bsh</tt></dd>
</dl>
</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
Remember to include any necessary quotes for text strings and JMeter variables that represent text strings.
</td></tr>
</table>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__groovy">21.5.13 __groovy</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The <tt class="code">__groovy</tt> function evaluates <a href="http://groovy-lang.org/">Apache Groovy</a> scripts passed to it, and returns the result.
</p>
<p>
If the property "<tt class="code">groovy.utilities</tt>" is defined, it will be loaded by the ScriptEngine.
This can be used to define common methods and variables. There is a
sample init file in the <tt class="code">bin</tt> directory: <tt class="code">utility.groovy</tt>.
</p>
<p>
The following variables are set before the script is executed:
</p>
<ul>
<li><tt class="code">log</tt> - the <a href="https://www.slf4j.org/api/org/slf4j/Logger.html">Logger</a> for the groovy function (*)</li>
<li><tt class="code">ctx</tt> - <a href="../api/org/apache/jmeter/threads/JMeterContext.html">JMeterContext</a> object</li>
<li><tt class="code">vars</tt> - <a href="../api/org/apache/jmeter/threads/JMeterVariables.html">JMeterVariables</a> object</li>
<li><tt class="code">props</tt> - JMeterProperties (class <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html"><tt class="code">java.util.Properties</tt></a>) object</li>
<li><tt class="code">threadName</tt> - the threadName (String)</li>
<li><tt class="code">sampler</tt> - the current <a href="../api/org/apache/jmeter/samplers/Sampler.html">Sampler</a>, if any</li>
<li><tt class="code">prev</tt> - the previous <a href="../api/org/apache/jmeter/samplers/SampleResult.html">SampleResult</a>, if any</li>
<li><tt class="code">OUT</tt> - System.out</li>
</ul>
<p>
(*) means that this is set before the init file, if any, is processed.
Other variables vary from invocation to invocation.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Expression to evaluate</td>
<td>A groovy script (not a file name)
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>Argument values that themselves contain commas should be escaped as necessary.
If you need to include a comma in your parameter value, escape it like this: '<tt class="code">\,</tt>'</td></tr>
</table>
</p>
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Name of variable</td>
<td>A reference name for reusing the value
computed by this function.</td>
<td>
No
</td>
</tr>
</table>
<p>
Example:
<dl>
<dt><tt class="code">${__groovy(123*456)}</tt></dt><dd>returns <tt class="code">56088</tt></dd>
<dt><tt class="code">${__groovy("${var}".substring(0\,2))}</tt></dt><dd>If var's value is <tt class="code">JMeter</tt>, it will return <tt class="code">JM</tt> as it runs <tt class="code">String.substring(0,2)</tt>. Note
that <tt class="code">,</tt> has been escaped to <tt class="code">\,</tt> </dd>
</dl>
</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>
Remember to include any necessary quotes for text strings and JMeter variables that represent text strings.
</td></tr>
</table>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__split">21.5.14 __split</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The split function splits the string passed to it according to the delimiter,
and returns the original string. If any delimiters are adjacent, "<tt class="code">?</tt>" is returned as the value.
The split strings are returned in the variables <tt class="code">${VAR_1}</tt>, <tt class="code">${VAR_2}</tt> etc.
The count of variables is returned in <tt class="code">${VAR_n}</tt>.
A trailing delimiter is treated as a missing variable, and "<tt class="code">?</tt>" is returned.
Also, to allow it to work better with the ForEach controller,
<tt class="code">__split</tt> now deletes the first unused variable in case it was set by a previous split.
</p>
<p></p>
Example:
<br>
Define <tt class="code">VAR</tt>="<tt class="code">a||c|</tt>" in the test plan.
<br>
<tt class="code">${__split(${VAR},VAR,|)}</tt>
<br>
This will return the contents of <tt class="code">VAR</tt>, i.e. "<tt class="code">a||c|</tt>" and set the following variables:
<br>
<tt class="code">VAR_n</tt>=<tt class="code">4</tt>
<br>
<tt class="code">VAR_1</tt>=<tt class="code">a</tt>
<br>
<tt class="code">VAR_2</tt>=<tt class="code">?</tt>
<br>
<tt class="code">VAR_3</tt>=<tt class="code">c</tt>
<br>
<tt class="code">VAR_4</tt>=<tt class="code">?</tt>
<br>
<tt class="code">VAR_5</tt>=<tt class="code">null</tt>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>String to split</td>
<td>A delimited string, e.g. "<tt class="code">a|b|c</tt>"</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Name of variable</td>
<td>A reference name for reusing the value
computed by this function.</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Delimiter</td>
<td>The delimiter character, e.g. <tt class="code">|</tt>.
If omitted, <tt class="code">,</tt> is used. Note that <tt class="code">,</tt> would need to be specified as <tt class="code">\,</tt>.
</td>
<td>
No
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__XPath">21.5.15 __XPath</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The XPath function reads an XML file and matches the XPath.
Each time the function is called, the next match will be returned.
At end of file, it will wrap around to the start.
If no nodes matched, then the function will return the empty string,
and a warning message will be written to the JMeter log file.
<p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>Note that the entire NodeList is held in memory.</td></tr>
</table>
</p>
</p>
<p></p>
Example:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__XPath(/path/to/build.xml, //target/@name)}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
This will match all targets in <tt class="code">build.xml</tt> and return the contents of the next name attribute
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>XML file to parse</td>
<td> a XML file to parse</td>
<td>
Yes
</td>
</tr>
<tr>
<td>XPath</td>
<td> a XPath expression to match nodes in the XML file</td>
<td>
Yes
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__setProperty">21.5.16 __setProperty</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The setProperty function sets the value of a JMeter property.
The default return value from the function is the empty string,
so the function call can be used anywhere functions are valid.</p>
<p>The original value can be returned by setting the optional 3<sup>rd</sup> parameter to "<tt class="code">true</tt>".</p>
<p>Properties are global to JMeter,
so can be used to communicate between threads and thread groups</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Property Name</td>
<td>The property name to be set.</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Property Value</td>
<td>The value for the property.</td>
<td>
Yes
</td>
</tr>
<tr>
<td>True/False</td>
<td>Should the original value be returned?</td>
<td>
No
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__time">21.5.17 __time</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The time function returns the current time in various formats.</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Format</td>
<td>
The format to be passed to SimpleDateFormat.
The function supports various shorthand aliases, see below.
If omitted, the function returns the current time in milliseconds since the epoch.
</td>
<td>
No
</td>
</tr>
<tr>
<td>Name of variable</td>
<td>The name of the variable to set.</td>
<td>
No
</td>
</tr>
</table>
<p>If the format string is omitted, then the function returns the current time in milliseconds since the epoch.
If the format matches "<tt class="code">/ddd</tt>" (where <tt class="code">ddd</tt> are decimal digits),
then the function returns the current time in milliseconds divided by the value of <tt class="code">ddd</tt>.
For example, "<tt class="code">/1000</tt>" returns the current time in seconds since the epoch.
Otherwise, the current time is passed to SimpleDateFormat.
The following shorthand aliases are provided:
</p><ul>
<li><tt class="code">YMD</tt> = <tt class="code">yyyyMMdd</tt></li>
<li><tt class="code">HMS</tt> = <tt class="code">HHmmss</tt></li>
<li><tt class="code">YMDHMS</tt> = <tt class="code">yyyyMMdd-HHmmss</tt></li>
<li><tt class="code">USER1</tt> = whatever is in the Jmeter property <tt class="code">time.USER1</tt></li>
<li><tt class="code">USER2</tt> = whatever is in the Jmeter property <tt class="code">time.USER2</tt></li>
</ul><p>The defaults can be changed by setting the appropriate JMeter property, e.g.
<tt class="code">time.YMD=yyMMdd</tt>
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__jexl2">21.5.18 __jexl2</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The jexl function returns the result of evaluating a
<a href="http://commons.apache.org/jexl">Commons JEXL expression</a>.
See links below for more information on JEXL expressions.
</p>
<p>The <tt class="code">__jexl2</tt> function uses Commons JEXL 2</p>
<ul>
<li><a href="http://commons.apache.org/proper/commons-jexl/reference/syntax.html">JEXL syntax description</a></li>
<li><a href="http://commons.apache.org/proper/commons-jexl/reference/examples.html#Example_Expressions">JEXL examples</a></li>
</ul>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Expression</td>
<td>
The expression to be evaluated. For example, <tt class="code">6*(5+2)</tt>
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Name of variable</td>
<td>The name of the variable to set.</td>
<td>
No
</td>
</tr>
</table>
<p>
The following variables are made available to the script:
</p><ul>
<li><tt class="code">log</tt> - the <a href="https://www.slf4j.org/api/org/slf4j/Logger.html">Logger</a> for the function</li>
<li><tt class="code">ctx</tt> - <a href="../api/org/apache/jmeter/threads/JMeterContext.html">JMeterContext</a> object</li>
<li><tt class="code">vars</tt> - <a href="../api/org/apache/jmeter/threads/JMeterVariables.html">JMeterVariables</a> object</li>
<li><tt class="code">props</tt> - JMeterProperties (class <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html"><tt class="code">java.util.Properties</tt></a>) object</li>
<li><tt class="code">threadName</tt> - String containing the current thread name</li>
<li><tt class="code">sampler</tt> - current <a href="../api/org/apache/jmeter/samplers/Sampler.html">Sampler</a> object (if any)</li>
<li><tt class="code">sampleResult</tt> - previous <a href="../api/org/apache/jmeter/samplers/SampleResult.html">SampleResult</a> object (if any)</li>
<li><tt class="code">OUT</tt> - System.out - e.g. <tt class="code">OUT.println("message")</tt></li>
</ul><p>
Jexl can also create classes and call methods on them, for example:
</p><p>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
Systemclass=log.class.forName("java.lang.System");
now=Systemclass.currentTimeMillis();
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
Note that the Jexl documentation on the web-site wrongly suggests that "<tt class="code">div</tt>" does integer division.
In fact "<tt class="code">div</tt>" and "<tt class="code">/</tt>" both perform normal division. One can get the same effect
as follows:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
i= 5 / 2;
i.intValue(); // or use i.longValue()
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>JMeter allows the expression to contain multiple statements.</td></tr>
</table>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__jexl3">21.5.19 __jexl3</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The jexl function returns the result of evaluating a
<a href="http://commons.apache.org/proper/commons-jexl/">Commons JEXL expression</a>.
See links below for more information on JEXL expressions.
</p>
<p>The <tt class="code">__jexl3</tt> function uses Commons JEXL 3</p>
<ul>
<li><a href="http://commons.apache.org/proper/commons-jexl/reference/syntax.html">JEXL syntax description</a></li>
<li><a href="http://commons.apache.org/proper/commons-jexl/reference/examples.html#Example_Expressions">JEXL examples</a></li>
</ul>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Expression</td>
<td>
The expression to be evaluated. For example, <tt class="code">6*(5+2)</tt>
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Name of variable</td>
<td>The name of the variable to set.</td>
<td>
No
</td>
</tr>
</table>
<p>
The following variables are made available to the script:
</p><ul>
<li><tt class="code">log</tt> - the <a href="https://www.slf4j.org/api/org/slf4j/Logger.html">Logger</a> for the function</li>
<li><tt class="code">ctx</tt> - <a href="../api/org/apache/jmeter/threads/JMeterContext.html">JMeterContext</a> object</li>
<li><tt class="code">vars</tt> - <a href="../api/org/apache/jmeter/threads/JMeterVariables.html">JMeterVariables</a> object</li>
<li><tt class="code">props</tt> - JMeterProperties (class <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Properties.html"><tt class="code">java.util.Properties</tt></a>) object</li>
<li><tt class="code">threadName</tt> - String containing the current thread name</li>
<li><tt class="code">sampler</tt> - current <a href="../api/org/apache/jmeter/samplers/Sampler.html">Sampler</a> object (if any)</li>
<li><tt class="code">sampleResult</tt> - previous <a href="../api/org/apache/jmeter/samplers/SampleResult.html">SampleResult</a> object (if any)</li>
<li><tt class="code">OUT</tt> - System.out - e.g. <tt class="code">OUT.println("message")</tt></li>
</ul><p>
Jexl can also create classes and call methods on them, for example:
</p><p>
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
Systemclass=log.class.forName("java.lang.System");
now=Systemclass.currentTimeMillis();
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
Note that the Jexl documentation on the web-site wrongly suggests that "<tt class="code">div</tt>" does integer division.
In fact "<tt class="code">div</tt>" and "<tt class="code">/</tt>" both perform normal division. One can get the same effect
as follows:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>
i= 5 / 2;
i.intValue(); // or use i.longValue()
</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
</p><p>
<table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>JMeter allows the expression to contain multiple statements.</td></tr>
</table>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__V">21.5.20 __V</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The V (variable) function returns the result of evaluating a variable name expression.
This can be used to evaluate nested variable references (which are not currently supported).
</p>
<p>For example, if one has variables <tt class="code">A1</tt>,<tt class="code">A2</tt> and <tt class="code">N</tt>=<tt class="code">1</tt>:</p>
<ul>
<li><tt class="code">${A1}</tt> - works OK</li>
<li><tt class="code">${A${N}}</tt> - does not work (nested variable reference)</li>
<li><tt class="code">${__V(A${N})}</tt> - works OK. <tt class="code">A${N}</tt> becomes <tt class="code">A1</tt>, and the <tt class="code">__V</tt> function returns the value of <tt class="code">A1</tt></li>
</ul>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Variable name</td>
<td>
The variable to be evaluated.
</td>
<td>
Yes
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__evalVar">21.5.21 __evalVar</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The evalVar function returns the result of evaluating an expression stored in a variable.
</p>
<p>
This allows one to read a string from a file, and process any variable references in it.
For example, if the variable "<tt class="code">query</tt>" contains "<tt class="code">select ${column} from ${table}</tt>"
and "<tt class="code">column</tt>" and "<tt class="code">table</tt>" contain "<tt class="code">name</tt>" and "<tt class="code">customers</tt>", then <tt class="code">${__evalVar(query)}</tt>
will evaluate as "<tt class="code">select name from customers</tt>".
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Variable name</td>
<td>
The variable to be evaluated.
</td>
<td>
Yes
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__eval">21.5.22 __eval</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>The eval function returns the result of evaluating a string expression.
</p>
<p>
This allows one to interpolate variable and function references in a string
which is stored in a variable. For example, given the following variables:
</p>
<ul>
<li><tt class="code">name</tt>=<tt class="code">Smith</tt></li>
<li><tt class="code">column</tt>=<tt class="code">age</tt></li>
<li><tt class="code">table</tt>=<tt class="code">birthdays</tt></li>
<li><tt class="code">SQL</tt>=<tt class="code">select ${column} from ${table} where name='${name}'</tt></li>
</ul>
then <tt class="code">${__eval(${SQL})}</tt> will evaluate as "<tt class="code">select age from birthdays where name='Smith'</tt>".
<p>
This can be used in conjunction with CSV Dataset, for example
where the both SQL statements and the values are defined in the data file.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Variable name</td>
<td>
The variable to be evaluated.
</td>
<td>
Yes
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__char">21.5.23 __char</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The char function returns the result of evaluating a list of numbers as Unicode characters.
See also <tt class="code">__unescape()</tt>, below.
</p>
<p>
This allows one to add arbitrary character values into fields.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Unicode character number (decimal or 0xhex)</td>
<td>
The decimal number (or hex number, if prefixed by <tt class="code">0x</tt>, or octal, if prefixed by <tt class="code">0</tt>) to be converted to a Unicode character.
</td>
<td>
Yes
</td>
</tr>
</table>
<p>Examples:
<br>
<tt class="code">${__char(13,10)}</tt> = <tt class="code">${__char(0xD,0xA)}</tt> = <tt class="code">${__char(015,012)}</tt> = <tt class="code">CRLF</tt>
<br>
<tt class="code">${__char(165)}</tt> = <tt class="code">¥</tt> (yen)
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__unescape">21.5.24 __unescape</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The unescape function returns the result of evaluating a Java-escaped string. See also <tt class="code">__char()</tt> above.
</p>
<p>
This allows one to add characters to fields which are otherwise tricky (or impossible) to define via the GUI.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>String to unescape</td>
<td>
The string to be unescaped.
</td>
<td>
Yes
</td>
</tr>
</table>
<p>Examples:
<br>
<tt class="code">${__unescape(\r\n)}</tt> = <tt class="code">CRLF</tt>
<br>
<tt class="code">${__unescape(1\t2)}</tt> = <tt class="code">1</tt>[tab]<tt class="code">2</tt>
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__unescapeHtml">21.5.25 __unescapeHtml</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
Function to unescape a string containing HTML entity escapes
to a string containing the actual Unicode characters corresponding to the escapes.
Supports HTML 4.0 entities.
</p>
<p>
For example, the string <tt class="code">"&lt;Fran&ccedil;ais&gt;"</tt>
will become <tt class="code">"<Français>"</tt>.
</p>
<p>
If an entity is unrecognized, it is left alone, and inserted verbatim into the result string.
e.g. <tt class="code">"&gt;&zzzz;x"</tt> will become <tt class="code">">&zzzz;x"</tt>.
</p>
<p>
Uses <tt class="code">StringEscapeUtils#unescapeHtml(String)</tt> from Commons Lang.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>String to unescape</td>
<td>
The string to be unescaped.
</td>
<td>
Yes
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__escapeHtml">21.5.26 __escapeHtml</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
Function which escapes the characters in a String using HTML entities.
Supports HTML 4.0 entities.
</p>
<p>
For example,<tt class="code">"bread" & "butter"</tt>
becomes:
<tt class="code">&quot;bread&quot; &amp; &quot;butter&quot;</tt>.
</p>
<p>
Uses <tt class="code">StringEscapeUtils#escapeHtml(String)</tt> from Commons Lang.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>String to escape</td>
<td>
The string to be escaped.
</td>
<td>
Yes
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__urldecode">21.5.27 __urldecode</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
Function to decode a <tt class="code">application/x-www-form-urlencoded</tt> string.
Note: use UTF-8 as the encoding scheme.
</p>
<p>
For example, the string <tt class="code">Word+%22school%22+is+%22%C3%A9cole%22+in+french</tt> would get converted to
<tt class="code">Word "school" is "école" in french</tt>.
</p>
<p>
Uses Java class <a href="http://docs.oracle.com/javase/7/docs/api/java/net/URLDecoder.html">URLDecoder</a>.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>String to decode</td>
<td>
The string with URL encoded chars to decode.
</td>
<td>
Yes
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__urlencode">21.5.28 __urlencode</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
Function to encode a string to a <tt class="code">application/x-www-form-urlencoded</tt> string.
</p>
<p>
For example, the string <tt class="code">Word "school" is "école" in french</tt> would get converted to
<tt class="code">Word+%22school%22+is+%22%C3%A9cole%22+in+french</tt>.
</p>
<p>
Uses Java class <a href="http://docs.oracle.com/javase/7/docs/api/java/net/URLEncoder.html">URLEncoder</a>.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>String to encode</td>
<td>
String to encode in URL encoded chars.
</td>
<td>
Yes
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__FileToString">21.5.29 __FileToString</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The FileToString function can be used to read an entire file.
Each time it is called it reads the entire file.
</p>
<p>If an error occurs opening or reading the file, then the function returns the string "<tt class="code">**ERR**</tt>"</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>File Name</td>
<td>Path to the file name.
(The path can be relative to the JMeter launch directory)
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>File encoding if not the platform default</td>
<td>
The encoding to be used to read the file. If not specified, the platform default is used.
</td>
<td>
No
</td>
</tr>
<tr>
<td>Variable Name</td>
<td>
A reference name - <tt class="code">refName</tt> - for reusing the value created by this function. Stored values are of the form <tt class="code">${refName}</tt>.
</td>
<td>
No
</td>
</tr>
</table>
<p>The file name, encoding and reference name parameters are resolved every time the function is executed.</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__samplerName">21.5.30 __samplerName</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The samplerName function returns the name (i.e. label) of the current sampler.
</p>
<p>
The function does not work in Test elements that don't have an associated sampler.
For example the Test Plan.
Configuration elements also don't have an associated sampler.
However some Configuration elements are referenced directly by samplers, such as the HTTP Header Manager
and Http Cookie Manager, and in this case the functions are resolved in the context of the Http Sampler.
Pre-Processors, Post-Processors and Assertions always have an associated Sampler.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Variable Name</td>
<td>
A reference name - <tt class="code">refName</tt> - for reusing the value created by this function. Stored values are of the form <tt class="code">${refName}</tt>.
</td>
<td>
No
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__TestPlanName">21.5.31 __TestPlanName</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
The TestPlanName function returns the name of the current test plan (can be used in Including Plans to know the name of the calling test plan).
</p>
<p>Example:
<div align="left">
<table cellspacing="4" cellpadding="0" border="0">
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#ffffff"><pre>${__TestPlanName}</pre></td>
<td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
<tr>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
<td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
</tr>
</table>
</div>
will return the file name of your test plan, for example if plan is in a file named Demo.jmx, it will return "<tt class="code">Demo.jmx</tt><br>
</p></td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__escapeOroRegexpChars">21.5.32 __escapeOroRegexpChars</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
Function which escapes the ORO Regexp meta characters, it is the equivalent of <tt class="code">\Q</tt> <tt class="code">\E</tt> in Java Regexp Engine.
</p>
<p>
For example,<tt class="code">[^"].+?</tt>
becomes:
<tt class="code">\[\^\"\]\.\+\?</tt>.
</p>
<p>
Uses Perl5Compiler#quotemeta(String) from ORO.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>String to escape</td>
<td>
The string to be escaped.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Variable Name</td>
<td>
A reference name - <tt class="code">refName</tt> - for reusing the value created by this function. Stored values are of the form <tt class="code">${refName}</tt>.
</td>
<td>
No
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3>
<a name="__escapeXml">21.5.33 __escapeXml</a>
</h3>
</font>
</td></tr>
<tr><td>
<p>
Function which escapes the characters in a String using XML 1.0 entities.
</p>
<p>
For example,<tt class="code">"bread" & 'butter'</tt>
becomes:
<tt class="code">&quot;bread&quot; &amp; &apos;butter&apos;</tt>.
</p>
<p>
Uses <tt class="code">StringEscapeUtils#escapeXml10(String)</tt> from Commons Lang.
</p>
<p>
<b>Parameters</b>
</p>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>String to escape</td>
<td>
The string to be escaped.
</td>
<td>
Yes
</td>
</tr>
</table>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
</blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="predefinedvars"><strong>21.6 Pre-defined Variables</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
Most variables are set by calling functions or by test elements such as User Defined Variables;
in which case the user has full control over the variable name that is used.
However some variables are defined internally by JMeter. These are listed below.
</p><ul>
<li><tt class="code">COOKIE_cookiename</tt> - contains the cookie value (see <a href="../usermanual/component_reference.html#HTTP_Cookie_Manager">HTTP Cookie Manager</a>)</li>
<li><tt class="code">JMeterThread.last_sample_ok</tt> - whether or not the last sample was OK - <tt class="code">true</tt>/<tt class="code">false</tt>.
Note: this is updated after PostProcessors and Assertions have been run.
</li>
<li><tt class="code">START</tt> variables (see next section)</li>
</ul></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#828DA6">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="predefinedprops"><strong>21.6 Pre-defined Properties</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<p>
The set of JMeter properties is initialised from the system properties defined when JMeter starts;
additional JMeter properties are defined in <tt class="code">jmeter.properties</tt>, <tt class="code">user.properties</tt> or on the command line.
</p><p>
Some built-in properties are defined by JMeter. These are listed below.
For convenience, the <tt class="code">START</tt> properties are also copied to variables with the same names.
</p><ul>
<li><tt class="code">START.MS</tt> - JMeter start time in milliseconds</li>
<li><tt class="code">START.YMD</tt> - JMeter start time as <tt class="code">yyyyMMdd</tt></li>
<li><tt class="code">START.HMS</tt> - JMeter start time as <tt class="code">HHmmss</tt></li>
<li><tt class="code">TESTSTART.MS</tt> - test start time in milliseconds</li>
</ul><p>
Please note that the <tt class="code">START</tt> variables / properties represent JMeter startup time, not the test start time.
They are mainly intended for use in file names etc.
</p></blockquote>
</td></tr>
<tr><td><br></td></tr>
</table>
</blockquote>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<br>
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="regular_expressions.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="properties_reference.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
</td>
</tr>
<tr><td>
<hr noshade size="1"/>
</td></tr>
<tr>
<td>
<table width=100%>
<tr>
<td>
<font color="#525D76" size="-1"><em>
Copyright © 1999-2017, Apache Software Foundation
</em></font>
</td>
<td align="right">
<font color="#525D76" size="-1"><em>
$Id: functions.xml 1790429 2017-04-06 17:04:19Z fschumacher $
</em></font>
</td>
</tr>
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1">
Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are
trademarks of the Apache Software Foundation.
</font>
</div>
</td></tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<!-- end the processing -->