0

У меня есть служба REST, которая имеет метод GET, запрос которого передается через URL. Вручную, когда я пытаюсь в Rest КЛИЕНТ я получаю правильный ответ, как показано ниже рис http://i.stack.imgur.com/cJkJS.png: -web_custom_request в Loadrunner с методом GET

URL передается: -

http://stg-services.star:9375/MobileCheckin/rest/KeylessMetrics?serviceRequest={"requestContextBean":{"requestTransactionID":"fa4dfc4b2b5244153e965361fcc8369711b59dad111020fdceafad16aa19","flowSeqNum":"567","globalContextParameters":["globalContext1","globalContext2"],"contextFrames":[{"name":"cfb1","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null},{"name":"cfb2","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null}]},"propId":421,"businessDate":"2016-06-30","metricName":["ALL"],"urgentlyWaitingTimeConfig":30} 

Но то же самое, когда я пытаюсь в LR с помощью web_custom_request, я получаю Внутренняя ошибка сервера 500.

Action() 
{ 
    web_custom_request("web_custom_request", 
    "URL=http://stg-services.star:9375/MobileCheckin/rest/KeylessMetrics?serviceRequest={\"requestContextBean\":{\"requestTransactionID\":\"fa4dfc4b2b5244153e965361fcc8369711b59dad111020fdceafad16aa19\",\"flowSeqNum\":\"567\",\"globalContextParameters\":[\"globalContext1\",\"globalContext2\"],\"contextFrames\":[{\"name\":\"cfb1\",\"type\":\"mci request\",\"serviceInterface\":\"getResIdsByMetricName\",\"operation\":\"getResIdsByMetricName\",\"localContextParameters\":[],\"ipaddress\":null},{\"name\":\"cfb2\",\"type\":\"mci request\",\"serviceInterface\":\"getResIdsByMetricName\",\"operation\":\"getResIdsByMetricName\",\"localContextParameters\":[],\"ipaddress\":null}]},\"propId\":421,\"businessDate\":\"2016-06-30\",\"metricName\":[\"ALL\"],\"urgentlyWaitingTimeConfig\":30}", 
    "Method=GET", 
    "TargetFrame=", 
    "RecContentType=application/x-www-form-urlencoded", 
    "Resource=0", 
    "Referer=", 
    "Mode=HTTP", 
    LAST); 

    return 0; 
} 

ответ в LR: -

Action.c(3):  HTTP/1.1 500 Internal Server Error\r\n 
Action.c(3):  X-Backside-Transport: FAIL FAIL,FAIL FAIL\r\n 
Action.c(3):  Connection: Keep-Alive\r\n 
Action.c(3):  Transfer-Encoding: chunked\r\n 
Action.c(3):  Content-Type: text/xml\r\n 
Action.c(3):  Date: Thu, 30 Jun 2016 13:28:27 GMT\r\n 
Action.c(3):  X-Client-IP: 10.132.132.6\r\n 
Action.c(3):  X-Global-Transaction-ID: 12678193\r\n 
Action.c(3):  \r\n 
Action.c(3): t=411ms: 4-byte chunked response overhead for "http://stg-services.star:9375/MobileCheckin/rest/KeylessMetrics?serviceRequest={"requestContextBean":{"requestTransactionID":"fa4dfc4b2b5244153e965361fcc8369711b59dad111020fdceafad16aa19","flowSeqNum":"567","globalContextParameters":["globalContext1","globalContext2"],"contextFrames":[{"name":"cfb1","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null},{"name":"cfb2","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null}]},"propId":421,"businessDate":"2016-06-30","metricName":["ALL"],"urgentlyWaitingTimeConfig":30}" (RelFrameId=1, Internal ID=1) 
Action.c(3):  fe\r\n 
Action.c(3): t=411ms: 7-byte chunked response overhead for "http://stg-services.star:9375/MobileCheckin/rest/KeylessMetrics?serviceRequest={"requestContextBean":{"requestTransactionID":"fa4dfc4b2b5244153e965361fcc8369711b59dad111020fdceafad16aa19","flowSeqNum":"567","globalContextParameters":["globalContext1","globalContext2"],"contextFrames":[{"name":"cfb1","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null},{"name":"cfb2","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null}]},"propId":421,"businessDate":"2016-06-30","metricName":["ALL"],"urgentlyWaitingTimeConfig":30}" (RelFrameId=1, Internal ID=1) 
Action.c(3):  \r\n 
Action.c(3):  0\r\n 
Action.c(3):  \r\n 
Action.c(3): t=416ms: 254-byte chunked response body for "http://stg-services.star:9375/MobileCheckin/rest/KeylessMetrics?serviceRequest={"requestContextBean":{"requestTransactionID":"fa4dfc4b2b5244153e965361fcc8369711b59dad111020fdceafad16aa19","flowSeqNum":"567","globalContextParameters":["globalContext1","globalContext2"],"contextFrames":[{"name":"cfb1","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null},{"name":"cfb2","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null}]},"propId":421,"businessDate":"2016-06-30","metricName":["ALL"],"urgentlyWaitingTimeConfig":30}" (RelFrameId=1, Internal ID=1) 
Action.c(3):  <?xml version="1.0" encoding="UTF-8"?>\n 
Action.c(3):  <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><env:Fault>< 
Action.c(3):  faultcode>env:Server</faultcode><faultstring>Internal Error (from server)</faultstring></e 
Action.c(3):  nv:Fault></env:Body></env:Envelope> 
Action.c(3): Error -26612: HTTP Status-Code=500 (Internal Server Error) for "http://stg-services.star:9375/MobileCheckin/rest/KeylessMetrics?serviceRequest={"requestContextBean":{"requestTransactionID":"fa4dfc4b2b5244153e965361fcc8369711b59dad111020fdceafad16aa19","flowSeqNum":"567","globalContextParameters":["globalContext1","globalContext2"],"contextFrames":[{"name":"cfb1","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null},{"name":"cfb2","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null}]},"propId":421,"businessDate":"2016-06-30","metricName":["ALL"],"urgentlyWaitingTimeConfig":30}" [MsgId: MERR-26612] Action.c(3): t=433ms: Closing connection [0] to stg-services.star after receiving status code 500 [MsgId: MMSG-26000] Action.c(3): t=433ms: Closed connection [0] to stg-services.star:9375 after completing 0 requests [MsgId: MMSG-26000] 
Action.c(3): t=433ms: Request done "http://stg-services.star:9375/MobileCheckin/rest/KeylessMetrics?serviceRequest={"requestContextBean":{"requestTransactionID":"fa4dfc4b2b5244153e965361fcc8369711b59dad111020fdceafad16aa19","flowSeqNum":"567","globalContextParameters":["globalContext1","globalContext2"],"contextFrames":[{"name":"cfb1","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null},{"name":"cfb2","type":"mci request","serviceInterface":"getResIdsByMetricName","operation":"getResIdsByMetricName","localContextParameters":[],"ipaddress":null}]},"propId":421,"businessDate":"2016-06-30","metricName":["ALL"],"urgentlyWaitingTimeConfig":30}" [MsgId: MMSG-26000] 
Action.c(3): web_custom_request("web_custom_request") highest severity level was "ERROR", 254 body bytes, 256 header bytes, 11 chunking overhead bytes  [MsgId: MMSG-26387] 
Ending action Action. 
Ending iteration 1. 
Ending Vuser... 
Starting action vuser_end. 
Ending action vuser_end. 
Vuser Terminated. 

Только изменение из Restclient и LR в формате URL-адреса, который я передаю. Может кто-нибудь, пожалуйста, помогите, почему я получаю внутреннюю ошибку сервера в LR, где как получение действительного ответа в RESTclient.

+0

Похоже, что некоторые заголовки отсутствуют в запросе, создаваемом LR. Вы можете установить инструмент Fiddler, записать с него запросы RestClient и VuGen, а затем сравнить их заголовки. – tserg42

+0

Спасибо, Tserg. Проблема заключалась в том, что формат URL-адреса передавался. Формат URL, полученный от скрипача, решил проблему. –

ответ

0

Я мог бы предложить записать этот разговор дважды из вашего restClient через прокси-рекордер LoadRunner. Я подозреваю, что смотрю на некоторые из полей и значений, которые могут иметь необработанные динамические данные. В конкретных, эти предметы выскочить на предметы, которые, вероятно, должны быть рассмотрены:

  • requestTransactionID
  • flowSeqNum
  • businessDate

я мог видеть два верхних элемента является динамичным и последним требуя, чтобы параметр переместился за пределы сегодняшней даты

Проверьте значения при записи несколько раз.

Вы также можете пропустить заголовок. Когда вы записываете, обязательно записывайте все заголовки для захвата того, что может отсутствовать.

+0

Спасибо Джеймсу за ответ. Когда я ударил URL с теми же параметрами данных элемента в остальном клиенте, я получаю действительный ответ несколько раз. Если упомянутые данные элемента были динамическими, тогда ответ в клиенте отдыха также должен быть ошибочным при попытке с одинаковыми параметрами более одного раза. Также нет заголовков. –

+0

Я предполагаю, что вы не записывали его дважды и сравнивали отмеченные предметы. –