{"id":2330,"date":"2011-08-12T10:52:39","date_gmt":"2011-08-12T14:52:39","guid":{"rendered":"http:\/\/www.webperformance.com\/load_testing\/blog\/?p=2330"},"modified":"2017-05-03T13:40:51","modified_gmt":"2017-05-03T17:40:51","slug":"json-support-in-load-tester-4-3","status":"publish","type":"post","link":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2011\/08\/json-support-in-load-tester-4-3\/","title":{"rendered":"Javascript\/JSON Support in Load Tester 4.3"},"content":{"rendered":"<p>Over the last year, Web Performance engineers have been working to make Load Tester smarter and easier to configure.\u00a0 Load Tester 4.2 introduced the new Fields View, which allows test case developers to write out HTTP requests using a flexible and composable assortment of data sources.<\/p>\n<p>Starting with Load Tester 4.3, Load Tester will automatically recognize JSON content in any HTTP request.\u00a0 As a consequence, each JSON element will become a configurable name-value pair field in the Fields View.\u00a0 We believe this will make it much easier to configure complex AJAX and RESTful style test cases.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2011\/07\/JSON-fields.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2333\" title=\"JSON in the Fields View\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2011\/07\/JSON-fields.png\" alt=\"Some JSON content in an HTTP POST, broken down in Load Tester's fields view by hierarchy and name-value pair.\" width=\"500\" height=\"116\" \/><\/a><\/p>\n<p>Furthermore, whenever Load Tester&#8217;s Application State Management tool runs, it will search for incoming name-value pairs that have matching outgoing name-value pairs.\u00a0 This search works only for JSON numbers and strings.\u00a0 When the ASM tool detects a match, it will automatically configure the test case to transmit the value it received.<\/p>\n<p>The screenshot below shows such a segment of JSON content.\u00a0 The &#8216;address_id&#8217; and &#8216;address&#8217; fields in this test case were provided by the web server in a separate response (not shown), extracted, and routed dynamically into all subsequent requests:<\/p>\n<p><a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2011\/07\/autoconfigged_json1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2335\" title=\"Autoconfigured JSON Content\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2011\/07\/autoconfigged_json1.png\" alt=\"A screenshot of the field edit dialog, with an automatically configured customer address hilighted in blue.\" width=\"500\" height=\"287\" \/><\/a><\/p>\n<p>For many users, this will completely automate test case development.\u00a0 Some users will need to add some custom configuration to simulate complex application logic.\u00a0 While other types of auto-configuration performed by Load Tester are highly reliable (so much so that we recommend that test case developers completely ignore automatically configured fields), the correctness of auto-configuration in JSON content can not in general be guaranteed.\u00a0 Automatically configured JSON fields will be incorrect in a handful of situations.<\/p>\n<p>Finally, there may be cases where Load Tester will not notice JSON content inside a request.\u00a0 In particular, the content may be hidden inside a query parameter or form field, or the content-type header may for some reason indicate that the content is something other than JSON.\u00a0 However, the user can mark <em>any<\/em> field as JSON content by using the &#8220;Parsers&#8221; tab in the field edit dialog.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2011\/07\/parser_selector1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2350\" title=\"Parser Selector\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2011\/07\/parser_selector1.png\" alt=\"Choosing a parser using the Field Edit Dialog\" width=\"500\" height=\"288\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2011\/07\/parser_selector.png\"><br \/>\n<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the last year, Web Performance engineers have been working to make Load Tester smarter and easier to configure.\u00a0 Load Tester 4.2 introduced the new Fields View, which allows test case developers to write out HTTP requests using a flexible and composable assortment of data sources.<br \/>\nStarting with Load Tester 4.3, Load Tester will automatically recognize JSON content in any HTTP request.\u00a0 As a consequence, each JSON element will become a configurable name-value pair field in the Fields View.\u00a0 We believe this will make it much easier to configure complex AJAX and RESTful style test cases.<br \/>\n<a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2011\/07\/JSON-fields.png\"><\/a><br \/>\nFurthermore, whenever Load Tester&#8217;s Application &hellip; <a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2011\/08\/json-support-in-load-tester-4-3\/\">Continue reading &raquo;<\/a><\/p>\n","protected":false},"author":53,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,69,8,42],"tags":[235,145,237],"class_list":["post-2330","post","type-post","status-publish","format-standard","hentry","category-ajax","category-javascript","category-load-testing","category-load-tester-software","tag-ajax","tag-json","tag-load-testing"],"_links":{"self":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/2330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/users\/53"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/comments?post=2330"}],"version-history":[{"count":25,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/2330\/revisions"}],"predecessor-version":[{"id":5721,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/2330\/revisions\/5721"}],"wp:attachment":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/media?parent=2330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/categories?post=2330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/tags?post=2330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}