loadrunner send json request

1 web_custom_request("Update Todo", 
2         "URL=http://localhost:3000/todos/3", 
3         "Method=PUT", 
4         "Resource=0", 
5         "EncType=application/json", 
6         "Mode=HTTP",
7         "Body={\"id\":3, \"isFinished\":false,\"todoText\":\"Updated the name\"}",
8         LAST);

 

web_custom_request("Update Todo", 
        "URL=http://172.25.192.16:8000/tool/network_test/monitor/", 
        "Method=POST", 
        "Resource=0", 
        "EncType=application/json", 
        "Mode=HTTP",
        "Body=[{\"project\":\"RPM\", \"name\":\"loadtest\", \"url\":\"www.loadrunner.com\", \"content_length\":\"188\", \"resp_time\":\"1.23\", \"status_code\":\"200\", \"status\":\"success\", \"client_ip\":\"192.192.192.192\", \"test_time\":\"now\"}]",
        LAST);

 

import subprocess

resp = subprocess.check_output("dir", shell = True)

print resp

resp = subprocess.check_output(
    "mdrv -usr C:\Users\JJ\Documents\VuGen\Scripts\WebHttpHtml1\WebHttpHtml1.usr", 
    shell = True)

print resp

 

posted on 2015-01-12 10:56  keep_walking  阅读(312)  评论(0)    收藏  举报