0

I have an application, which converts any long URL to short URL like this: https://{HOST}/short_link_name and my goal is to make working script.

User opens https://{HOST} in browser, passes the authentication form with credentials and sees the form for converting long URL to short URL. The form consists of 3 input fields:

{long_URL} - is any long URL which user need to convert into short URL
{short_URL_name} - is the name of link given by user for short URL
and the 3rd isn't important in this context.

Then user click button for submitting data and can see the result - short URL link below this form.

So, I made the manual script and the snippet of script is here:

web_url("{HOST}", 
    "URL=https://{HOST}/", 
    "Resource=0", 
    "RecContentType=text/html", 
    "Referer=", 
    "Mode=HTML", 
    EXTRARES, 
    "Url=//Grid/GetLinks?_dc=1383645884804&page=1&start=0&limit=6", ENDITEM,
    "Url=//Grid/GetLinks?_dc=1383645898655&page=1&start=0&limit=6", ENDITEM,
            "Url=/GetImage/Methodology?width=200&height=200", ENDITEM,
    LAST);

... (verifying that my username is displayed on the application page = I'm logged in)

web_submit_data("Register",
        "Action=https://{HOST}/UrlRegistration/Register", 
        "Method=POST", 
        "RecContentType=application/json", 
        "Referer=https://{HOST}/", 
        "Mode=HTML", 
        ITEMDATA, 
        "Name=ShortUrl", "Value={short_URL_name}", ENDITEM, 
        "Name=LongUrl", "Value=http://{long_URL}", ENDITEM, 
        "Name=Persistent", "Value=false", ENDITEM, 
        LAST);

Notes:

1) the values like _dc=1383645884804 are timestamp;

2) I'm logged in application page successfully;

3) https://{HOST}/UrlRegistration/Register doesn't physically exist in HTML-code of submitting form of application.

The problem is, when I run script, for this snippet I have ERROR with next text:

Action.c(65): web_submit_data("Register") started
Action.c(65): Error -26627: HTTP Status-Code=404 (Not Found) for "https://{HOST}/UrlRegistration/Register"
Action.c(65): web_submit_data("Register") highest severity level was "ERROR", 1245 body bytes, 287 header bytes

The HTML snippet for this form:

<form action="/" method="post">
 ...
</form>

Why I have this error with web_submit_data and what should I do to get correctly working script? Could you help me, please?

With checked option "data returned by server" in extended log I have next:

Action.c(32): web_submit_data("Register") started   [MsgId: MMSG-26355]
Action.c(32): t=123159ms: 308-byte response headers for "https://{HOST}/UrlRegistration/Register" (RelFrameId=1, Internal ID=22)
Action.c(32):     HTTP/1.1 401 Unauthorized\r\n
Action.c(32):     Cache-Control: private\r\n
Action.c(32):     Content-Type: text/html\r\n
Action.c(32):     Server: Microsoft-IIS/7.5\r\n
Action.c(32):     X-AspNetMvc-Version: 4.0\r\n
Action.c(32):     X-AspNet-Version: 4.0.30319\r\n
Action.c(32):     WWW-Authenticate: Negotiate\r\n
Action.c(32):     WWW-Authenticate: NTLM\r\n
Action.c(32):     X-UA-Compatible: IE=Edge, chrome=1\r\n
Action.c(32):     Date: Tue, 05 Nov 2013 10:15:18 GMT\r\n
Action.c(32):     Content-Length: 1293\r\n
Action.c(32):     \r\n
Action.c(32): t=123229ms: 1293-byte response body for "https://{HOST}/UrlRegistration/Register" (RelFrameId=1, Internal ID=22)
Action.c(32):     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/
Action.c(32):     xhtml1-strict.dtd">\r\n
Action.c(32):     <html xmlns="http://www.w3.org/1999/xhtml">\r\n
Action.c(32):     <head>\r\n
Action.c(32):     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>\r\n
Action.c(32):     <title>401 - Unauthorized: Access is denied due to invalid credentials.</title>\r\n
Action.c(32):     <style type="text/css">\r\n
...
Action.c(32):     </style>\r\n
Action.c(32):     </head>\r\n
Action.c(32):     <body>\r\n
Action.c(32):     <div id="header"><h1>Server Error</h1></div>\r\n
Action.c(32):     <div id="content">\r\n
Action.c(32):      <div class="content-container"><fieldset>\r\n
Action.c(32):       <h2>401 - Unauthorized: Access is denied due to invalid credentials.</h2>\r\n
Action.c(32):       <h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>\r\n
Action.c(32):      </fieldset></div>\r\n
Action.c(32):     </div>\r\n
Action.c(32):     </body>\r\n
Action.c(32):     </html>\r\n
Action.c(32): t=123387ms: 506-byte response headers for "https://{HOST}/UrlRegistration/Register" (RelFrameId=1, Internal ID=22)
Action.c(32):     HTTP/1.1 401 Unauthorized\r\n
Action.c(32):     Content-Type: text/html; charset=us-ascii\r\n
Action.c(32):     Server: Microsoft-HTTPAPI/2.0\r\n
Action.c(32):     WWW-Authenticate: NTLM TlRMTVNTUAACAAAACgAKADgAAAAFgomiq9WGN92mlIoAAAAAAAAAAKwArABCAAAABgGxHQAAAA9NAEkATgBTAEsAAgAKAE0ASQBOAFMASwABABoARQBWAEIAWQBNAEkATgBTAEQANQAxADIAMQAEABwAbQBpAG4AcwBrAC4AZQBwAGEAbQAuAGMAbwBtAAMAOABFAFYAQgBZAE0ASQBOAFMARAA1ADEAMgAxAC4AbQBpAG4AcwBrAC4AZQBwAGEAbQAuAGMAbwBtAAUAEABlAHAAYQBtAC4AYwBvAG0ABwAIANN9tO0P2s4BAAAAAA==\r\n
Action.c(32):     Date: Tue, 05 Nov 2013 10:15:18 GMT\r\n
Action.c(32):     Content-Length: 341\r\n
Action.c(32):     \r\n
Action.c(32): t=123447ms: 341-byte response body for "https://{HOST}/UrlRegistration/Register" (RelFrameId=1, Internal ID=22)
Action.c(32):     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">\r
Action.c(32):     \n
Action.c(32):     <HTML><HEAD><TITLE>Not Authorized</TITLE>\r\n
Action.c(32):     <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>\r\n
Action.c(32):     <BODY><h2>Not Authorized</h2>\r\n
Action.c(32):     <hr><p>HTTP Error 401. The requested resource requires user authentication.</p>\r\n
Action.c(32):     </BODY></HTML>\r\n
Action.c(32): t=123586ms: 287-byte response headers for "https://{HOST}/UrlRegistration/Register" (RelFrameId=1, Internal ID=22)
Action.c(32):     HTTP/1.1 404 Not Found\r\n
Action.c(32):     Cache-Control: private, s-maxage=0\r\n
Action.c(32):     Content-Type: text/html\r\n
Action.c(32):     Server: Microsoft-IIS/7.5\r\n
Action.c(32):     X-AspNetMvc-Version: 4.0\r\n
Action.c(32):     X-AspNet-Version: 4.0.30319\r\n
Action.c(32):     Persistent-Auth: true\r\n
Action.c(32):     X-UA-Compatible: IE=Edge, chrome=1\r\n
Action.c(32):     Date: Tue, 05 Nov 2013 10:15:18 GMT\r\n
Action.c(32):     Content-Length: 1245\r\n
Action.c(32):     \r\n
Action.c(32): t=123645ms: 1245-byte response body for "https://{HOST}/UrlRegistration/Register" (RelFrameId=1, Internal ID=22)
Action.c(32):     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/
Action.c(32):     xhtml1-strict.dtd">\r\n
Action.c(32):     <html xmlns="http://www.w3.org/1999/xhtml">\r\n
Action.c(32):     <head>\r\n
Action.c(32):     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>\r\n
Action.c(32):     <title>404 - File or directory not found.</title>\r\n
Action.c(32):     <style type="text/css">\r\n
...
Action.c(32):     </style>\r\n
Action.c(32):     </head>\r\n
Action.c(32):     <body>\r\n
Action.c(32):     <div id="header"><h1>Server Error</h1></div>\r\n
Action.c(32):     <div id="content">\r\n
Action.c(32):      <div class="content-container"><fieldset>\r\n
Action.c(32):       <h2>404 - File or directory not found.</h2>\r\n
Action.c(32):       <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>\r\n
Action.c(32):      </fieldset></div>\r\n
Action.c(32):     </div>\r\n
Action.c(32):     </body>\r\n
Action.c(32):     </html>\r\n
Action.c(32): Error -26627: HTTP Status-Code=404 (Not Found) for "https://{HOST}/UrlRegistration/Register"      [MsgId: MERR-26627]
Action.c(32): web_submit_data("Register") highest severity level was "ERROR", 2879 body bytes, 1101 header bytes    [MsgId: MMSG-26388]

Does the timestamp affect on error appearing?

Nadezhda T
  • 262
  • 8
  • 24

1 Answers1

1

Rule of thumb: Record twice with the same user ID. Those items which change from one recording session to the next are not optional to address. This is per your timestamp labled items. Add a third recording under a different user ID and this will expose items which are account specific which need to be addressed.

James Pulley
  • 5,606
  • 1
  • 14
  • 14
  • Yes, I see that timestamp is changed from record to record, and if I put strings with timestamp in /* */ errors appeared connected with this place of script. If I save current timestamp in a parameter and then use this parameter in web_url, I also have error. I have not yet figured out how get around this error. Thanks for idea about 2nd user! – Nadezhda T Nov 08 '13 at 10:23
  • 1
    Commenting out items which are in the request is not an appropriate development model for virtual users – James Pulley Nov 11 '13 at 13:43