{"id":5118,"date":"2015-01-06T10:05:31","date_gmt":"2015-01-06T14:05:31","guid":{"rendered":"http:\/\/www.webperformance.com\/load-testing-tools\/blog\/?p=5118"},"modified":"2015-01-06T10:05:31","modified_gmt":"2015-01-06T14:05:31","slug":"extracting-values-browser","status":"publish","type":"post","link":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2015\/01\/extracting-values-browser\/","title":{"rendered":"Extracting Values from the Browser"},"content":{"rendered":"<p>Occasionally, a testcase requires a bit of information from one page in the testcase to be used on another page, later in the testcase. In some cases, this is exactly what a real user would do (e.g. click on a link chosen based on text that appeared earlier). Other times, it is a hidden identifier that is used to choose the right element from a list later. Either way, an <em>Extract a value<\/em> step can be used to get data from the browser.<\/p>\n<p><a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2014\/12\/ExtractStepExample.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5121\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2014\/12\/ExtractStepExample.png\" alt=\"ExtractStepExample\" width=\"500\" height=\"52\" \/><\/a><\/p>\n<p>In the above example, an attribute value is extracted and stored in a user state variable named <em>invoice_number<\/em>. This value can be anywhere a datasource is configured (by configuring a user state variable datasource), such as a Type or Verify step.<\/p>\n<p>Values can be extracted from these sources:<\/p>\n<ul>\n<li>URL of the page<\/li>\n<li>Title of the page<\/li>\n<li>Visible text on the page<\/li>\n<li>Source HTML of the page<\/li>\n<li>Visible text of an element<\/li>\n<li>Value of an attribute of an element<\/li>\n<\/ul>\n<p>As always, if you have questions about this new feature, please comment here or <a href=\"https:\/\/www.webperformance.com\/sales\/contact.html\">contact us<\/a>. We&#8217;re here to help!<\/p>\n<p>Chris Merrill, Chief Engineer<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Occasionally, a testcase requires a bit of information from one page in the testcase to be used on another page, later in the testcase. In some cases, this is exactly what a real user would do (e.g. click on a link chosen based on text that appeared earlier). Other times, it is a hidden identifier that is used to choose the right element from a list later. Either way, an Extract a value step can be used to get data from the browser.<br \/>\n<a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2014\/12\/ExtractStepExample.png\"><\/a><br \/>\nIn the above example, an attribute value is extracted and stored in a user state variable named &hellip; <a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2015\/01\/extracting-values-browser\/\">Continue reading &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,204,197],"tags":[],"class_list":["post-5118","post","type-post","status-publish","format-standard","hentry","category-load-testing","category-qa-and-functional-testing","category-real-browser"],"_links":{"self":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/5118","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/comments?post=5118"}],"version-history":[{"count":5,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/5118\/revisions"}],"predecessor-version":[{"id":5133,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/5118\/revisions\/5133"}],"wp:attachment":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/media?parent=5118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/categories?post=5118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/tags?post=5118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}