XML Custom Requests - and Responses
Okay, if you are 'testing' XML pages rather than the regular HTTP pages - you can use lr_xml_find to text-check your responses. Recently I was required to code a test that sends an XML File to a service and gets a return XML file. The following is the code that works. You can program many variants of XML tests. Refer to Pages 1115-1128 of the VUGen guide "Programming with the XML API" for further details
The Code:
Action()
{
//Save XML Data into Character Variable
char *xml_input=
""
""
"100 "
"1234567 "
""
"VTEST "
"USD "
"4111123456789022 "
"123 "
"2012 "
""
""
"8 "
"9 "
"2006 "
"";
//Move Character Variable value into Parameter for LR
lr_save_string(xml_input,"XML_Input_Param");
//Capture all XML Data using WebRegSaveParam
web_reg_save_param("ServerXML", "LB=", "RB=", "Search=body", LAST);
/*Send Custom Request - using XML from XML_Input_Param in which char variable data has been saved */
web_custom_request("SendXML",
"URL=https://10.10.xxx.xxx:8080/authService",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"Mode=HTTP",
"Body={XML_Input_Param}",
LAST);
//Converted XPath verifications
lr_xml_find("XML={ServerXML}",
"Query=/CCAuthResponse/responseCode",
"Value=1",
LAST );
return 0;
}
The Code:
Action()
{
//Save XML Data into Character Variable
char *xml_input=
"
""
"
"
"
"
"
"
"
"
""
""
"
"
"
"";
//Move Character Variable value into Parameter for LR
lr_save_string(xml_input,"XML_Input_Param");
//Capture all XML Data using WebRegSaveParam
web_reg_save_param("ServerXML", "LB=", "RB=", "Search=body", LAST);
/*Send Custom Request - using XML from XML_Input_Param in which char variable data has been saved */
web_custom_request("SendXML",
"URL=https://10.10.xxx.xxx:8080/authService",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"Mode=HTTP",
"Body={XML_Input_Param}",
LAST);
//Converted XPath verifications
lr_xml_find("XML={ServerXML}",
"Query=/CCAuthResponse/responseCode",
"Value=1",
LAST );
return 0;
}
7 Comments:
Nice to read the article which you posted lastly, its helpful to enhance my knowledge as well as for my career
hp loadrunner training in chennai
Loadrunner classes in Chennai
performance testing training in chennai
hp loadrunner training
performance testing training
By Karthik, at 2:23 AM
Thank you so much for all the wonderful information about Technology! I love your work.
javascript training in chennai
js class
Hibernate Training in Chennai
core java training in chennai
Spring Training in Chennai
QTP Training in Chennai
Manual Testing Training in Chennai
JMeter Training in Chennai
By sandeep saxena, at 5:01 AM
Thanks for the well-written post and I will follow your updates regularly.
GST Training in Chennai
GST classes in Chennai
GST Training classes in Chennai
ccna Training in Chennai
Ethical Hacking course in Chennai
Hacking course in Chennai
PHP Training in Chennai
GST Training in Velachery
GST Training in T Nagar
GST Training in OMR
By priya rajesh, at 5:37 AM
Informative post indeed, I’ve being in and out reading posts regularly and I see alot of engaging people sharing things and majority of the shared information is very valuable and so, here’s my fine read.
click here en espanol
click here email virus
click here email
click here em português
click here eps
By unknown, at 11:25 PM
Thanks for sharing such a great blog Keep posting..
Loadrunner Training in Delhi
By manisha, at 12:25 AM
"Wonderful post, This article have helped greatly continue writing .. share more related to e like page.
Digital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
"
By saran, at 7:37 PM
Nice. I am really impressed with your writing talents and also with the layout on your weblog. Appreciate, Is this a paid subject matter or did you customize it yourself? Either way keep up the nice quality writing, it is rare to peer a nice weblog like this one nowadays. Thank you, check also event marketing and Steps for Launching a Slack Community for Your Virtual Event
By Jon Hendo, at 2:16 AM
Post a Comment
<< Home