OAS 3.0.3 request schema for an empty JSON body
I am attempting to create an OAS schema for an empty JSON body: { } I am trying to get the documentation to show an empty JSON body, and have that autogenerated. The API defines this as a POST (yes, it ought to be a GET, the design of the API is in some respects sub-optimal) request, and expects the open/close bracket, and nothing else. I've tried … content: application/json: { } … but that doesn't work (it just shows nothing in the request body), and everything else I've tried is invalid. Would appreciate any assistance on this. I have not been able to find any examples or even similar questions (maybe I’m looking in the wrong place?). Any assistance would be greatly appreciated!Solved6.2KViews0likes2Commentsexport json swagger with response member details
can I export "json" swagger with full response from "Soapui"? the swagger exported contains just response status code, not details. my swagger output: {"swagger":"2.0","info":{"version":"1.0","title":"http://localhost:54480"},"basePath":"http://localhost:54480/CustomerImage.svc/GetCustomerPicture/?IdentityNumber=123&AccountNumber=123","paths":{"/CustomerImage.svc/GetCustomerPicture":{"get":{"operationId":"CustomerImage.svc","parameters":[{"name":"IdentityNumber","in":"query","required":false,"type":"string"},{"name":"AccountNumber","in":"query","required":false,"type":"string"}],"responses":{"0":{},"404":{},"200":{},"500":{}}}}}1.3KViews0likes1CommentConvert XML to Json format - jScript
Hey guys, I curretly have an XML file that I use to map some test data so I could create another XML file and send it somwhere. Current XML format is: <Mappings> <Test id="Test_1000_test"> <TestIdMapping>Test_1001_test1</TestIdMapping> <TestIdMapping>Test_1002_test2</TestIdMapping> </Test> <Test id="Test_2000_test"> <TestIdMapping>Test_2001_test1</TestIdMapping> <TestIdMapping>Test_2002_test2</TestIdMapping> <TestIdMapping>Test_2003_test3</TestIdMapping> </Test> <Mappings> Basically I am mapping 1001, 1002 to 1000....... I would like to switch this file to JSON and have it in TestComplete instead of reading it from the outside (external XML). What's is the best way to it ? I have an idea in head but I would like your opinion. Please note that file could have up to few hundreds tests.1.9KViews0likes11CommentsWhat does <*> symbol represent in json swagger?
I have a question in JSON swagger. May I know what does <*> symbol represent in JSON swagger? This is how the format looks like after I import the JSON swagger into the online editor. What does <*> actually mean? CrossCurrencyRequest{ items* { < * >: CurrencyPairRequest{ amount* number currencyPair* string decimalPlace integer($int32) } } } Below are the definitions from the swagger file. definitions: CrossCurrencyRequest: type: object required: - items properties: items: type: object additionalProperties: $ref: '#/definitions/CurrencyPairRequest' title: CrossCurrencyRequest I have the sample request as given below. How to make the request generates the "key1", "key2", etc? As it seems like not a predefined object from the swagger file. Sample request: { "items": { "key1": { "amount": 1000.123456789, "currencyPair": "USD-SGD", "decimalPlace": 5 }, "key2": { "amount": 1000.12345, "currencyPair": "USD-IDR" }, "key3": { "amount": 1000.12345, "currencyPair": "USD-ZNH" } } }SolvedHow to convert JSON to XML using xslt?
Hi All, How can I convert the below JSON input request to XML format using XSLT I have tried with this XSLT from here https://www.quora.com/Is-there-a-way-to-convert-JSON-to-JSONX-without-using-IBM-DataPower but I didn't get desired output and it's throwing an error:"illegal character { at offset 0" in Datapower. My input request: { "SMS": [{ "to": "+966874939494", "Message": "<subject+message> " }, { "to": "+96687499490", "Message": "<subject+message>" } ] } My Expected Output: <?xml version="1.0" encoding="UTF-8"?> <sendReq> <MsgRqHdr> <RqUID>SR_123</RqUID> <SCId>SF12</SCId> <FuncId>36</FuncId> <UsrId>S12</UsrId> <Dt>2020-05-26T15:12:13</Dt> <Service>SMS</Service> </MsgRqHdr> <Body> <Com> <Specific> <Type>SMS</Type> </Specific> <CValue> <Char> <Name>ID</Name> </Char> <Value>966560329031</Value> </CValue> <CValue> <Char> <Name>Event</Name> </Char> <Value>subject&messagetext</Value> </CValue> <CValue> <Char> <Name>EventParam</Name> </Char> <Value>English</Value> </CValue> </Com> </Body> Can someone help on this please ? I never even tried Gateway script to give a try.3.1KViews0likes2CommentsGetting java.lang.NoClassDefFoundError in Ready API
HI all, I have a need where I need to come up with a function which with return a Jason to map Json { "a": { "b": 1, "c": null, "d": [false, true] }, "e": "f", "g": 2.3 } Map Key Value a.b 1 a.c null a.d[0] false a.d[1] true e f g 2.3 This can be done using JsonFlattener jar and was implemented in Eclipse, so added that external Jar in Ready API under “Custom Java libraries” but on executing this function it error out with message “java.lang.NoClassDefFoundError”, can some one please help me how this can be resolved. Below is the code import com.github.wnameless.json.flattener.JsonFlattener; public def func1(def expected){ def resultMap = [ : ]; resultMap = JsonFlattener.flattenAsMap(expected) return resultMap; }Solved1.9KViews0likes5CommentsCompare two REST response and ignore some fields
to compare two json response i can use below function but in the current context response return some dynamic fields which will be unique every time, can some one please explain how we can handle this void compareResponse(def atcualresponse, def expectedREsponse){ def map1 = new JsonSlurper().parseText(atcualresponse) def map2 = new JsonSlurper().parseText(expectedREsponse) assert map1 == map2 }Solved4.4KViews0likes7CommentsHow to save log.info/error/warning from groovy test step
Hi, I have big groovy script usable in both SoapUI Free and SoapUI pro. i have there lots of Log Outgoing how to save them by groovy script? all logs i found and try some kudos have result like this: /***********************enum test*************/ import com.eviware.soapui.model.testsuite.Assertable.AssertionStatus // firsthly def ArrayList - enums // this enums is available for change if another enums will change, dont change another part of code List<String> country = new ArrayList<String> (["MK", "AD", "AE", "AF"]) //, "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "CH", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"]) log.info "!!!!!!!Dont stop this Test Step!!!!!!!!!" log.info "!!!!!!!Dont change this Test Step when run!!!!!!!!!" log.info "!!!!!!!Wait for results at least 10 minutes!!!!!!!!!" //def actual test Case and Test STep def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ); def testCase = testRunner.testCase; def testStep = testCase.getTestStepAt(context.currentStepIndex + 2); //set property country with value item into TestCase testRunner.testCase.setPropertyValue("country", country[0]) //log.info testStep + ": " + country[0] //now run test step (will be run by count of enum values) testRunner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(testCase, null); testStepContext = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext(testStep); testStep.run(testRunner, testStepContext); // here we detect if test case were failed (when is not firsth if, then list all assertion test steps in test case, is usable as Tear Down Script too) def StepList = testCase.getTestStepList() if (country != country[0] && country[0] != null){ StepList.each{ if(it.metaClass.hasProperty(it,'assertionStatus')){ if(it.assertionStatus != AssertionStatus.FAILED){ log.error "${it.name} FAIL with value of: " + item return; } else if(it.assertionStatus == AssertionStatus.VALID){ log.info "${it.name} OK!" // now loop arrayList value by value it means item and run it in Test step MTD-ESB-TLM-Country-all (next 1th test step) for (String item : country) { //set property country with value item into TestCase testRunner.testCase.setPropertyValue("country", item) //log.info testStep + ": " + item //now run test step (will be run by count of enum values) testRunner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(testCase, null); testStepContext = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext(testStep); testStep.run(testRunner, testStepContext); } } else if(it.assertionStatus == AssertionStatus.UNKNOWN){ log.info "${it.name} UNKNOWN (PROBABLY NOT ALREADY EXECUTED)" log.error "${it.name} FAIL with value of: " + item return; } } } } }/***********************enum test*************/ import com.eviware.soapui.model.testsuite.Assertable.AssertionStatus // firsthly def ArrayList - enums // this enums is available for change if another enums will change, dont change another part of code List<String> country = new ArrayList<String> (["MK", "AD", "AE", "AF"]) //, "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "CH", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"]) log.info "!!!!!!!Dont stop this Test Step!!!!!!!!!" log.info "!!!!!!!Dont change this Test Step when run!!!!!!!!!" log.info "!!!!!!!Wait for results at least 10 minutes!!!!!!!!!" //def actual test Case and Test STep def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ); def testCase = testRunner.testCase; def testStep = testCase.getTestStepAt(context.currentStepIndex + 2); //set property country with value item into TestCase testRunner.testCase.setPropertyValue("country", country[0]) //log.info testStep + ": " + country[0] //now run test step (will be run by count of enum values) testRunner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(testCase, null); testStepContext = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext(testStep); testStep.run(testRunner, testStepContext); // here we detect if test case were failed (when is not firsth if, then list all assertion test steps in test case, is usable as Tear Down Script too) def StepList = testCase.getTestStepList() if (country != country[0] && country[0] != null){ StepList.each{ if(it.metaClass.hasProperty(it,'assertionStatus')){ if(it.assertionStatus != AssertionStatus.FAILED){ log.error "${it.name} FAIL with value of: " + item return; } else if(it.assertionStatus == AssertionStatus.VALID){ log.info "${it.name} OK!" // now loop arrayList value by value it means item and run it in Test step MTD-ESB-TLM-Country-all (next 1th test step) for (String item : country) { //set property country with value item into TestCase testRunner.testCase.setPropertyValue("country", item) //log.info testStep + ": " + item //now run test step (will be run by count of enum values) testRunner = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner(testCase, null); testStepContext = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext(testStep); testStep.run(testRunner, testStepContext); } } else if(it.assertionStatus == AssertionStatus.UNKNOWN){ log.info "${it.name} UNKNOWN (PROBABLY NOT ALREADY EXECUTED)" log.error "${it.name} FAIL with value of: " + item return; } } } } } It means: it log only part of code, but not log.info/error/warning... from Log Output with the values of variables - I may made it manualy, but I want execute all project from command line its general task from our DevOps. How to script it in both versions (not all testers here have full version) Thanks for answer1.2KViews0likes3CommentsReadyAPI- How to assert 2 test runs based on date in response?
Hello, As our project is evolving fearcely I'm now on a crossroad to assert that my response from the new run is updated with the latest version of the third party. Some explanations: Testrun1: Response comes from our environment in JSON format that was filled through ETL with an image from a third party. It should contain a 'PDCMetaData' (wrong notation in the screenshot) and a 'PDCData' node (with content that differse for each project). In the 'PDCMetaData' there's a DateTime stamp in 'authorityProcessingDateTime' that shows e.g. 31/12/2018 It should look something like this: TestRun2: A new version was uploaded through ETL to our environment and the DateTime in 'PDSMetaData' is now 31/12/2019. How can I assert that this date is changed and shows me that a new version is present? Could anybody give me an idea please? Thanks in advance, Kind Regards, AboveAndBeyond986Views0likes2CommentsfindReviews method referenced in JSON API
I’m trying to use Code Collaborator’s JSON API (collab-common 11.5.11503 API)to find reviews by searching for a particular field, however I’m having trouble understanding how to use the findReviews method in the API. The goal is to search a certain field for a particular string in order to find reviews. For example: {"command":"ReviewService.findReviews", "args":{"searchText":"Updater", "customFieldName":"title"}} My understanding is that this command should search for reviews containing “Updater” in their title. However, when running this command, the reviews returned contain “Updater” in fields not just limited to the title. I can’t find examples or support on how to use this function properly. Also, once I can get findReviews to return reviews that fit more limited search criteria, I wanted to know if I could use fields that are not returned in the results as search criteria. For example, “Completed On” is an available field in a review, but it isn’t a field returned in the find request.Solved1.9KViews0likes1Comment