Reuse adapted xml file and send in REST
Hi SmartBear, Long time ago that I was here (under a different name :-) ). Glad to be back though ;-) So, my question: We want to send a file as Query, cached, multipart/form-data. After sending we need to adapt, e.g. the vinnumber, save the file and send again with REST request. For the moment I have this: import groovy.xml.XmlParser import groovy.xml.XmlUtil // 1 Generate VIN def chars = "ABCDEFGHJKLMNPRSTUVWXYZ0123456789" def random = new Random() def generatedVin = (1..17).collect { chars[random.nextInt(chars.length())] }.join() log.info "Generated VIN: " + generatedVin // 2 Get file path from test case level -->wll fetch it from folder project def filePath = context.expand('${#TestCase#file}') def file2 = new File(filePath) log.info "File path: " + filePath // 3 Parse XML def xml = new XmlParser().parse(file) // 4 Update VIN xml.Body.VehicleTransportOrder.Line.Vehicle.VehicleID[0].value.generatedVin // 5 Write updated XML def writer = new FileWriter(file2) XmlUtil.serialize(xml, writer) writer.close() log.info "VIN replaced successfully" The original file came with the composite testproject as everybody needs to be able to reach that file. We don't know if this would be better put in a folder because we will have different files from different clients. But this is what we came up to. The file is read correctly, the vinnumber = generated, but the new number can't be put in that attached file anymore. Anybody an idea on what should be the best steps now? Thanks in advance, AAB53Views0likes0CommentsRunning ReadyAPI Suite via Command Line / C# took ~ 30 sec to initiate
Hi, I'm currently executing the Ready API suite using C# by triggering testrunner.bat. The execution works as expected; however, it takes approximately 30 seconds to initiate the run. Is there any way to optimize or speed up this startup time? I’d appreciate any suggestions. Below is the command I’m using: string soapCommandLine = $"-s {suiteName} " + $" -c {caseName} {readyAPIprojectPath} ";94Views0likes0CommentsRest request attachments multipart form data for json file with parameterized json data
So I have been trying to do a scenario where i have two attachments for a rest request, one json file which i need to parameterize couple of fields from previous request. The problem with this is once you have cached the attachment you cannot modify it based on the previous test steps, So i have followed the following youtube link https://www.youtube.com/watch?v=iL-zehJmtWw Used query parameter to use a locally store file of json to request but we are getting the error from response that application/octet-stream content type is not accepted ------=_Part_01_136051460.1696260652738 Content-Disposition: form-data; name="testFile" testFile:/Path/to/file/testFile.json I have used parameter like this testFile:${projectDir}/testFile.json What should I do in this case1.6KViews0likes7CommentsRunTestCase input and return proeprties of the same name
Hello! I have a test case module that loads a set of around 100 properties from multiple databases, performs some logic with the data and then outputs the whole set into the testcase properties. I want to have the option to input some of the properties into the test case when I use a Run Test Case test step and if my logic detects the input, it won't load those specific properties from database. What I am struggling with is that if I set the Run test case step properties as Return properties, it ignores the data i put into the Run test case properties, and if I don't set them as return properties, the empty input properties don't get overwritten with the DB loaded data. Do you have any tips how I could achieve to have shared input and return properties?64Views0likes0CommentsData Source test step doesn't output arrays into properties
Hello! I am using Ready Api GUI 3.57.0 and I am trying to setup a modular, data-driven general testcase. I am using GUI only to setup the test, and now I encountered a strange situation when using Data Source test step I have a nested array and I am currently trying to use JSON DataSource to iterate over the root array and save the nested array into a property. And I am failing to do so. When I point to the Array I want to save into the property, if saves Null. When I point to the first member (i = 0) of the array, it shows the data properly. Could anybody please help me check if I am the one who's doing something wrong, or it is ReadyApi being moody? To make the situation more specific: This is my JSON data source: { "name": "Get_PC", "toTest": true, "templatesDirectoryPath": "I:/Testing/AutotestSourceDataFiles/P1/Get_PC", "a_webServiceDefinition":[ { "name":"2018/05", "toTest": true, "webServiceUri": "/P1/2018/05", "o_nameSpaceDefinitions": [ {"nsName": "soapenv", "nsUrl": "http://schemas.xmlsoap.org/soap/envelope/"}, {"nsName": "ns", "nsUrl": "http://www.data.com/2013/08"}, {"nsName": "ns1", "nsUrl": "http://ws.com/2018/05"} ] }, { "name":"2023/09", "toTest": true, "webServiceUri": "/P1/2023/09", "o_nameSpaceDefinitions": [ {"nsName": "soapenv", "nsUrl": "http://schemas.xmlsoap.org/soap/envelope/"}, {"nsName": "ns", "nsUrl": "http://www.data.com/2023/04"}, {"nsName": "ns1", "nsUrl": "http://ws.com/2023/09"} ] } ] } My DataSource test steps configuration is: Data Source Type: JSON Step and property points to the aforementioned JSON string Row Path: $['a_webServiceDefinition'] Column Path: ['o_nameSpaceDefinitions'] According to JSON PATH documentation and validators, the JSON PATH: $['a_webServiceDefinition'][0]['o_nameSpaceDefinitions'] should return the array I want, but it is returning NULL. Also, when I modify column Path to ['o_nameSpaceDefinitions'] [0], it correctly returns the first object in the array. Is there a problem on my side?53Views0likes0CommentsReadyAPI 3.56.0 does not fail testcase if iteration in datasource fails
Hi, We have a datasource which takes data from excel to feed in the request. This excel has multiple rows, each row creates a different request and each row gets it's own assertion data. Since release 3.56.0, it seems like whenever an iteration fails from the datasource that is NOT the very last row in the datasource, the test case will still be reported as passed. As a workaround, I'm trying to create a custom testcase property "hasFailed" with a standard value of "false". Whenever an assertion fails, the testcase property is set on "true", but whenever I try to execute the follow script in my test case teardown script: def hasFailed = testRunner.testCase.getPropertyValue("hasFailed") if (hasFailed == "true") { log.info(hasFailed) testRunner.fail("Testcase failed, check transaction log for more details") } it doesn't seem to work. The log.info is displayed but the testRunner.fail doesn't fail the test case itself. Any tips on how to fix this?140Views2likes1CommentSpecifying a specific Schema when connecting to Postgres Database Connection
Hi all .. I have no trouble connecting my ReadyAPI application to a Postgres database. However, I need to specify a specific schema to connect to. Say the schema i need to connect to is called bluesky how do i modify my connection string so that the queries hit that specific schema? jdbc:postgresql://0.0.0.1:5432/oompaloompa?user=player1&password=PASS_VALUESolved216Views0likes1CommentAuto-Populate Data Generator "Value from set" values
Is there anyway to automatically populate the values list in the "Value from set" option in the Data Generator section of the Data Source step? Digging through the API definition for the DataGenerator DataSource step https://support.smartbear.com/readyapi/apidocs/3.0.0/pro/com/eviware/soapui/impl/wsdl/teststeps/datasource/DataGenerator/UI/DataGeneratorDataSource.html I could probably do this with a call to setConfig but was wondering if I was missing something easier? We need to run some load tests on a system to do some troubleshooting. Each request needs to submit one of a selection of id's. This would be simple and not a problem except that these id's change on a daily basis. We also want these to run with minimal need for user intervention. RegardsSolved82Views0likes1Comment