{"id":5187,"date":"2015-03-06T15:57:49","date_gmt":"2015-03-06T19:57:49","guid":{"rendered":"http:\/\/www.webperformance.com\/load-testing-tools\/blog\/?p=5187"},"modified":"2016-09-08T17:11:31","modified_gmt":"2016-09-08T21:11:31","slug":"editing-recorded-urls","status":"publish","type":"post","link":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2015\/03\/editing-recorded-urls\/","title":{"rendered":"How to Change Recorded Hostnames\/Edit Recorded URLs"},"content":{"rendered":"<p>Users occasionally ask how to update URLs or hostnames in a recorded testcase so that a recording can be used with a new URL or server. Editing recorded hostnames\u00a0may be necessary for several reasons, including:<\/p>\n<ul>\n<li>Moving a website from one server to another<\/li>\n<li>Using a testcase developed for a testing server against a production server, or vice versa<\/li>\n<\/ul>\n<h2><strong>Typical Situations and Methods of Editing Recorded Hostnames<\/strong><\/h2>\n<p>Web\u00a0Performance Tester offers several tools for changing\u00a0recorded hostnames. Below, I describe common situations testers may experience and the appropriate method of changing datasources.<\/p>\n<p><strong>1.<\/strong> In the simplest case, a single new hostname must replace a single recorded hostname. In this situation, use the URL Editor. The URL Editor allows testers to enter a new datasource for a recorded hostname. All future tests will redirect traffic through the edited datasource.<\/p>\n<ul>\n<li>The Fields View performs a similar function. Use the Fields View to select individual instances of a recorded hostname, instead of applying a blanket edit.<\/li>\n<\/ul>\n<p><strong>2.<\/strong> Complicated websites often pull content from numerous locations. In these cases, changing from one server to another may require more configuration than simply swapping one hostname with another. In this instance, testers have two options:<\/p>\n<ul>\n<li>If the website does not require requests using a specific recorded hostname, use the URL Editor or the Fields View<\/li>\n<li>If the system expects requests to appear using a specific recorded hostname, edit the Custom HOSTS file<\/li>\n<\/ul>\n<h3>Choosing a Method<\/h3>\n<p>In summary:<\/p>\n<p>If you reach the new target server through a different hostname in your browser, use the <a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2015\/03\/editing-recorded-urls\/#URL%20Editor\">URL Editor<\/a> or <a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2015\/03\/editing-recorded-urls\/#Fields%20View\">Fields View<\/a> to edit the\u00a0datasource of a recorded hostname.<\/p>\n<p>If you reach the new target server by using the same URL in your browser and\u00a0editing your OS HOSTS file, use\u00a0Load Tester\u2019s <a href=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/2015\/03\/editing-recorded-urls\/#Custom%20Hosts%20File\">custom HOSTS file<\/a>.<\/p>\n<h2>Performing Each Method<\/h2>\n<p>The following sections contained detailed steps for performing each method of editing recorded hostnames.<\/p>\n<p><strong><em>NOTE: The following methods are only applicable to &#8220;Virtual Browser&#8221; recordings.<\/em><\/strong><\/p>\n<h3 style=\"text-align: left;\"><a id=\"URL Editor\"><\/a>URL Editor<\/h3>\n<p>The URL Editor may be used to replace all instances of a recorded hostname with a new hostname.<\/p>\n<p>To edit datasources using the URL Editor:<\/p>\n<p><strong>1.<\/strong> In the navigator panel, select a recording.<\/p>\n<p><strong>2.<\/strong> Switch to URL Editor mode by selecting \u201cOptions\u00a0-&gt; View -&gt; URL Editor.\u201d<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5536\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-one-view-url-editor.png\" alt=\"\" width=\"600\" height=\"191\" \/><\/p>\n<p style=\"text-align: left;\"><strong>3.\u00a0<\/strong>In the \u201cDatasource\u201d column, select the field which corresponds to the recorded URL, then click the \u201c\u2026\u201d icon to open the \u201cEdit Field\u201d menu.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5532 size-full\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-one-datasource-column.png\" alt=\"\" width=\"474\" height=\"89\" \/><\/p>\n<p><strong>4. <\/strong>From the \u201cEdit Field\u201d popup menu, expand the drop down menu beside \u201cDatasource\u201d and select the \u201cText Constant\u201d option.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5533\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-one-edit-field-popup-1.png\" alt=\"\" width=\"600\" height=\"183\" \/><\/p>\n<p style=\"text-align: left;\"><strong>5.<\/strong> After selecting &#8220;Text constant,&#8221; replace the current datasource with a new value and click &#8220;OK.&#8221;<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5534\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-one-edit-field-popup-2.png\" alt=\"\" width=\"600\" height=\"311\" \/><\/p>\n<p style=\"text-align: left;\"><strong>6.\u00a0<\/strong>The URL listed in the &#8220;Datasource&#8221; column will reflect the new value.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5535 size-full\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-one-reflecting-edits.png\" alt=\"\" width=\"481\" height=\"67\" \/><\/p>\n<p><strong>7<\/strong>. After editing the datasource and\u00a0returning to the\u00a0\u201cStepped Order\u201d view, the hostname appears with a green background. The green background indicates that future tests will redirect traffic through the edited datasource.<\/p>\n<h3 style=\"text-align: left;\"><a id=\"Fields View\"><\/a>Fields View<\/h3>\n<p>The Fields View allows users to view each\u00a0recorded instance of a connection with the hostname. This tool allows users to edit individual entries.<\/p>\n<p>To edit datasources using the Fields View:<\/p>\n<p style=\"text-align: left;\"><strong>1.\u00a0<\/strong>In the navigator panel, select a recording.<\/p>\n<p style=\"text-align: left;\"><strong>2.<\/strong> In the inspection window located in the lower half of the Web Performance application, select the &#8220;Fields&#8221; tab.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5540\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-Two-Fields-tab.png\" alt=\"\" width=\"600\" height=\"228\" \/><\/p>\n<p style=\"padding-left: 30px;\"><strong>Note:<\/strong> If the \u201cFields\u201d tab states \u201cSelect a Testcase, Web Page, or Transaction containing fields,\u201d in the testcase editor window, select \u201cOptions,\u201d then \u201cView\u201d -&gt; \u201cStepped Order.\u201d<\/p>\n<p><strong>3.\u00a0<\/strong>Expand the dropdown menu located at the right corner of the window and select &#8220;Hostnames.&#8221;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5541\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-Two-hostnames.png\" alt=\"\" width=\"600\" height=\"228\" \/><\/p>\n<p><strong>4.\u00a0<\/strong>Select each entry for which the datasource needs to be changed, right click, and click &#8220;Edit.&#8221;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5543\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-Two-edit-hostnames.png\" alt=\"\" width=\"600\" height=\"227\" \/><\/p>\n<p style=\"text-align: left;\"><strong>5.<\/strong> From the \u201cEdit Field\u201d popup menu, expand the drop down menu beside \u201cDatasource\u201d and select the \u201cText Constant\u201d option.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5533\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-one-edit-field-popup-1.png\" alt=\"\" width=\"600\" height=\"183\" \/><\/p>\n<p style=\"text-align: left;\"><strong>6. <\/strong>After selecting &#8220;Text constant,&#8221; replace the current datasource with a new value and click &#8220;OK.&#8221;<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5534\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-one-edit-field-popup-2.png\" alt=\"\" width=\"600\" height=\"311\" \/><\/strong><\/p>\n<p><strong>7.<\/strong> After editing a datasource and\u00a0returning to the\u201cFields View\u201d view, edited entries appear with a green background. The green background indicates that future tests will redirect traffic through the edited datasource.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5539\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-Two-edited-hostnames.png\" alt=\"\" width=\"600\" height=\"74\" \/><\/p>\n<h3 style=\"text-align: left;\"><a id=\"Custom Hosts File\"><\/a>Custom HOSTS file<\/h3>\n<p>If you must access a web application through a specific recorded hostname, configure a Custom HOSTS file to redirect traffic to a different IP address.<\/p>\n<p>To edit the datasource by configuring the HOSTS file:<\/p>\n<p style=\"text-align: left;\"><strong>1.\u00a0<\/strong>In the toolbar, select &#8220;Tools,&#8221; then select &#8220;Open custom HOSTS file.&#8221;<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5538 size-full\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-Three-custom-hosts.png\" alt=\"\" width=\"345\" height=\"135\" \/><\/p>\n<p style=\"text-align: left;\"><strong>2.\u00a0<\/strong>Create a new entry to assign an existing hostname to another hostname or IP address.<\/p>\n<p style=\"text-align: left;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5537\" src=\"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-content\/uploads\/2015\/03\/Method-Three-custom-hosts-2.png\" alt=\"\" width=\"600\" height=\"191\" \/><\/p>\n<p>Load Tester will use the custom HOSTS file during future load tests.<\/p>\n<h2 style=\"text-align: left;\">Verifying the Change<\/h2>\n<p style=\"text-align: left;\">When editing individual datasources, missed entries may reduce testcase accuracy or result in errors. Unedited entries that receive a valid response from the original datasource may be difficult to find.<\/p>\n<p style=\"text-align: left;\"><strong style=\"color: #222222;\">Pro Tip<\/strong><span style=\"color: #222222;\">: &#8220;After running a replay, Options -&gt; View -&gt; Flat URL Comparison. Click the URL column to sort by URL, then scan down the list for any names that look out of place&#8221;. &#8211; Frank<\/span><\/p>\n<p>Users may also edit the HOSTS file to redirect traffic for the original hostname to an invalid address. Unedited entries will return an error rather than a potentially valid response.<\/p>\n<p>-Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web Performance Tester offers several tools for changing recorded hostnames. Below, I describe common situations users may experience, and the appropriate method of changing datasources for each.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,42],"tags":[174,237,213,212],"class_list":["post-5187","post","type-post","status-publish","format-standard","hentry","category-load-testing","category-load-tester-software","tag-how-to","tag-load-testing","tag-recorded-url","tag-virtual-browser"],"_links":{"self":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/5187","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/comments?post=5187"}],"version-history":[{"count":43,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/5187\/revisions"}],"predecessor-version":[{"id":5544,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/posts\/5187\/revisions\/5544"}],"wp:attachment":[{"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/media?parent=5187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/categories?post=5187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webperformance.com\/load-testing-tools\/blog\/wp-json\/wp\/v2\/tags?post=5187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}