0

我在一个网页上记录了一个脚本,其中包含一个我通常输入邮政编码的文本字段,另一个字段根据我输入的邮政编码进行更新。重播 svript 时出现错误。我认为我的问题与生成的脚本包含一个 web_submit_data 我作为邮政编码的一部分输入的每个数字有关。

这是我在第一个 web_submit_data 之后得到的错误消息:

错误 -26612:“和一些 url”的 HTTP 状态代码 = 500(内部服务器错误)[MsgId:MER-26612]]

有人知道这个问题和可能的解决方案吗?此处描述为:

http://www.myloadtest.com/scripting-exercise-a-basic-ajax-application/

谢谢!


我的代码如下。它是使用 web/http 协议的记录器,当我输入一个自动填充字段/自动完成字段时它正在记录,所以当我在邮政编码字段中输入 7000 时,LR 会为我输入的每个数字生成一个 web_submit_data。我不知道是不是这样是问题面团。

行动() {

web_url("nav_security_check", 
    "URL=http://someurl.local:8080/brukerprofil/nav_security_check?id=12345678910", 
    "Resource=0", 
    "RecContentType=text/html", 
    "Referer=", 
    "Snapshot=t1.inf", 
    "Mode=HTML", 
    EXTRARES, 
    "Url=img/nav_logo.gif", "Referer=http://someurl.local:8080/brukerprofil/brukerprofil?0", ENDITEM, 
    LAST);

lr_think_time(4);

web_submit_data("brukerprofil", 
    "Action=http://someurl.local:8080/brukerprofil/brukerprofil?0-1.IBehaviorListener.0-brukerprofil~skjema-valgtAdresseType", 
    "Method=POST", 
    "RecContentType=text/xml", 
    "Referer=http://someurl.local:8080/brukerprofil/brukerprofil?0", 
    "Snapshot=t2.inf", 
    "Mode=HTML", 
    ITEMDATA, 
    "Name=valgtAdresseType", "Value=radio11", ENDITEM, 
    LAST);

lr_think_time(4);

web_submit_data("brukerprofil_2", 
    "Action=http://someurl.local:8080/brukerprofil/brukerprofil?0-1.IBehaviorListener.1-brukerprofil~skjema-valgtAdresseType-alternativAdressePanel-norskAlternativPostnummer", 
    "Method=POST", 
    "RecContentType=text/xml", 
    "Referer=http://someurl.local:8080/brukerprofil/brukerprofil?0", 
    "Snapshot=t3.inf", 
    "Mode=HTML", 
    ITEMDATA, 
    "Name=valgtAdresseType:alternativAdressePanel:norskAlternativPostnummer", "Value=7", ENDITEM, 
    LAST);

web_submit_data("brukerprofil_3", 
    "Action=http://someurl.local:8080/brukerprofil/brukerprofil?0-1.IBehaviorListener.1-brukerprofil~skjema-valgtAdresseType-alternativAdressePanel-norskAlternativPostnummer", 
    "Method=POST", 
    "RecContentType=text/xml", 
    "Referer=http://someurl.local:8080/brukerprofil/brukerprofil?0", 
    "Snapshot=t4.inf", 
    "Mode=HTML", 
    ITEMDATA, 
    "Name=valgtAdresseType:alternativAdressePanel:norskAlternativPostnummer", "Value=70", ENDITEM, 
    LAST);

web_submit_data("brukerprofil_4", 
    "Action=http://someurl.local:8080/brukerprofil/brukerprofil?0-1.IBehaviorListener.1-brukerprofil~skjema-valgtAdresseType-alternativAdressePanel-norskAlternativPostnummer", 
    "Method=POST", 
    "RecContentType=text/xml", 
    "Referer=http://someurl.local:8080/brukerprofil/brukerprofil?0", 
    "Snapshot=t5.inf", 
    "Mode=HTML", 
    ITEMDATA, 
    "Name=valgtAdresseType:alternativAdressePanel:norskAlternativPostnummer", "Value=700", ENDITEM, 
    LAST);

web_submit_data("brukerprofil_5", 
    "Action=http://someurl.local:8080/brukerprofil/brukerprofil?0-1.IBehaviorListener.1-brukerprofil~skjema-valgtAdresseType-alternativAdressePanel-norskAlternativPostnummer", 
    "Method=POST", 
    "RecContentType=text/xml", 
    "Referer=http://someurl.local:8080/brukerprofil/brukerprofil?0", 
    "Snapshot=t6.inf", 
    "Mode=HTML", 
    ITEMDATA, 
    "Name=valgtAdresseType:alternativAdressePanel:norskAlternativPostnummer", "Value=7000", ENDITEM, 
    LAST);

web_submit_data("brukerprofil_6", 
    "Action=http://someurl.local:8080/brukerprofil/brukerprofil?0-1.IBehaviorListener.1-brukerprofil~skjema-valgtAdresseType-alternativAdressePanel-norskAlternativPostnummer", 
    "Method=POST", 
    "RecContentType=text/xml", 
    "Referer=http://someurl.local:8080/brukerprofil/brukerprofil?0", 
    "Snapshot=t7.inf", 
    "Mode=HTML", 
    ITEMDATA, 
    "Name=valgtAdresseType:alternativAdressePanel:norskAlternativPostnummer", "Value=7000", ENDITEM, 
    LAST);

web_submit_data("brukerprofil_7", 
    "Action=http://someurl.local:8080/brukerprofil/brukerprofil?0-1.IBehaviorListener.2-brukerprofil~skjema-valgtAdresseType-alternativAdressePanel-norskAlternativPostnummer", 
    "Method=POST", 
    "RecContentType=text/xml", 
    "Referer=http://someurl.local:8080/brukerprofil/brukerprofil?0", 
    "Snapshot=t8.inf", 
    "Mode=HTML", 
    ITEMDATA, 
    "Name=valgtAdresseType:alternativAdressePanel:norskAlternativPostnummer", "Value=7000", ENDITEM, 
    LAST);

lr_think_time(6);

web_submit_data("brukerprofil_8", 
    "Action=http://someurl.local:8080/brukerprofil/brukerprofil?0-1.IBehaviorListener.1-brukerprofil~skjema-kontonummer", 
    "Method=POST", 
    "RecContentType=text/xml", 
    "Referer=http://someurl.local:8080/brukerprofil/brukerprofil?0", 
    "Snapshot=t9.inf", 
    "Mode=HTML", 
    ITEMDATA, 
    "Name=kontonummer", "Value=62281154546", ENDITEM, 
    LAST);

web_submit_data("brukerprofil_9", 
    "Action=http://someurl.local:8080/brukerprofil/brukerprofil?0-1.IFormSubmitListener-brukerprofil~skjema", 
    "Method=POST", 
    "RecContentType=text/html", 
    "Referer=http://someurl.local:8080/brukerprofil/brukerprofil?0", 
    "Snapshot=t10.inf", 
    "Mode=HTML", 
    ITEMDATA, 
    "Name=brukerprofil-skjema_hf_0", "Value=", ENDITEM, 
    "Name=valgtAdresseType", "Value=radio11", ENDITEM, 
    "Name=valgtAdresseType:alternativAdressePanel:norskAlternativPostAdresse1", "Value=Nedgata 2", ENDITEM, 
    "Name=valgtAdresseType:alternativAdressePanel:norskAlternativPostAdresse2", "Value=Postboks 2", ENDITEM, 
    "Name=valgtAdresseType:alternativAdressePanel:norskAlternativPostAdresse3", "Value=Sentrum 123", ENDITEM, 
    "Name=valgtAdresseType:alternativAdressePanel:norskAlternativPostnummer", "Value=7000", ENDITEM, 
    "Name=kontonummer", "Value=62281154546", ENDITEM, 
    "Name=mobilpanel:landkode", "Value=47", ENDITEM, 
    "Name=mobilpanel:nummer", "Value=98765432", ENDITEM, 
    "Name=telefonnummerpanel:landkode", "Value=47", ENDITEM, 
    "Name=telefonnummerpanel:nummer", "Value=22225555", ENDITEM, 
    "Name=ekstra-telefonnummerpanel:landkode", "Value=46", ENDITEM, 
    "Name=ekstra-telefonnummerpanel:nummer", "Value=11223344", ENDITEM, 
    "Name=epost", "Value=per.hansen@hjemme.no", ENDITEM, 
    LAST);

return 0;

}

4

3 回答 3

1

My bet is that you have unhandled dynamic data. This is very much related to your other post. Looking at the requests you have noted there are several items that stick out as likely unhandled elements of Dynamic data and one security ID that seems completely faked.

Record your busines process 2-3 times. Use WinDiff (Included with LoadRunner) or another file DIFF tool that you like to identify the differences between the recordings. The dynamic elements should literally jump off the page as differences between the recordings. You will need to handle these dynamic elements appropriately if you wish your script to continue.

Also, Testing 101 housekeeping items, for each step there is an expected result. Conspicuously absent in your code is any sort of check for a correct expected result. In such a case it's quite easy for an HTTP 200 status page to be returned which is completely out of context for your business process, but when allows your script to continue. In such a condition where you have "come off the tracks" and do not know if due to the lack of checking for expected results it is a 100% certainty that you will hit an HTTP 500 within 1-2 request sets.

于 2012-11-23T14:46:47.180 回答
0

当服务器出现内部错误(例如 PHP 脚本出错)时,会生成 HTTP 错误 500。如果您可以发布发出 ajax 请求的代码和它正在获取的文件(只是内容很好),我可以提供帮助。

于 2012-11-22T21:59:03.067 回答
0

Magnus,我可以建议您停止使用记录按钮并查看 HTTP 级别发生的情况,而不是依赖工具来获取请求。

我建议你花一些时间在FirebugHTTP WatchFiddler上,先看看应用程序实际上在做什么。

如果您不知道手动操作时会发生什么,您就无法实现自动化。

于 2012-11-23T03:55:09.590 回答