Forum Discussion
Thanks for your response.
Actually there will be some upgrade in the server.
Before upgrade, i need to run my request against the server and i ll capture response and store in my drive.
After upgrade i need to hit the same server with the same request. At that time i need to compare the current response with the already stored response dynamically using groovy.
test data is normal xml response.
<?xml version="1.0" ?>
<Process>
<Execution>
<Execution_Date>2015/11/16 15:58:05</Execution_Date>
<Process_File>Sample_2015-11-16_153023.xml</Process_File>
<Client>IBLLC</Client>
<Client_Master_Acct>FXXXXXXX</Client_Master_Acct>
</Execution>
<Applications>
<Application External_ID="ABCD1002" Status="Success">
<Customer>Joseph Clientman</Customer>
<Users>
<User external_id="ABCD1002USR" password="xxxxxxxx">jocmn841</User>
</Users>
<Accounts>
<Account external_id="ABCD1002AC">UXXXXXXX</Account>
</Accounts>
<Entities>
<Entity external_id="ABCD1002AH">20951330</Entity>
</Entities>
<Pending_Tasks>
<Task Task_Number="87745956" Form_Number="1005" Form_Name="Margin Agreement" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745947" Form_Number="2192" Form_Name="Privacy Statement" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745948" Form_Number="3007" Form_Name="Customer Agreement (v2)" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745949" Form_Number="3024" Form_Name="Forex and Multi-Currency Risk Disclosure" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745955" Form_Number="3044" Form_Name="US Bond Risk Disclosure" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745950" Form_Number="3070" Form_Name="Business Continuity Plan Disclosure" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745951" Form_Number="3071" Form_Name="Day Trading Risk Disclosure" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745952" Form_Number="3074" Form_Name="Order Routing and Payment for Order Flow Disclosure" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745963" Form_Number="3076" Form_Name="ISE Disclosure for Option Orders Over 500 Contracts" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745964" Form_Number="3077" Form_Name="Municipal Bond Risk Disclosure" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745968" Form_Number="4003" Form_Name="OCC Risk Disclosure" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745953" Form_Number="4016" Form_Name="After-hours Trading Risk Disclosure" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745941" Form_Number="4035" Form_Name="Mutual Fund Agreement" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745973" Form_Number="4036" Form_Name="Mutual Fund Disclosure" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745936" Form_Number="6105" Form_Name="Client FA Agreement" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745937" Form_Number="6108" Form_Name="Agreement Limiting Interactive Brokers Liability" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
<Task Task_Number="87745981" Form_Number="9130" Form_Name="US Stock Stop Order Disclosure" Action="to sign" Is_Required_For_Approval="true" Is_Required_For_Trading="false" Is_Online_Task="true"></Task>
</Pending_Tasks>
</Application>
</Applications>
</Process>
- radhika17 years agoContributor
Hi Team,
Could you please let me know the solution for the same.
- radhika17 years agoContributorHi can someone share the same.
- Luffy7 years agoOccasional Contributor
You can save the response and store it externally using code:
def ResFile ="C:/Response1.xml"
def Res = context.expand( '${TestStep#Response}' )
def j = new File(ResFile)
j.write(Res, "UTF-8")You can use the Groovy XMLUnit utility like this to compare the XML files.
XMLUnit.setIgnoreWhitespace(true) XMLUnit.setIgnoreComments(true) XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true) XMLUnit.setNormalizeWhitespace(true) XMLUnit.compareXML(expectedXml, actualXml)
- radhika16 years agoContributor
hello,
Could you please give me the script to compare two json files and print the mismatches in tags and values please...Any help is highly appreciated.
Related Content
- 2 years ago
- 2 years ago
- 2 years ago
Recent Discussions
- 2 days ago