How to set different Content-Types in multipart/form-data POST Request?
I have a REST API, that I can curl correctly, but I can not get it done in ReadyApi. I have to upload a picture and a json string, which has the content-type "type=application/json": curl -X 'POST' 'http:/localhost:12345/rest/add' -H 'Content-Type: multipart/form-data' -F 'picture=@/home/my.jpg' -F 'criteria={"personId":"string"};type=application/json' I ticked "Post QueryString" and selected multipart/form-data. When I look up in the RAW tab, I see, that for criteria no content-type is set. The error message in ReadyApi says: Content type 'application/octet-stream' not supported It is necessary for me to set the content-type of my criteria JSON Object to "application/json". Otherwise I will get this error. I am on ReadyApi 3.45. Does anyone have a clue, how to solve the problem?Solved62Views0likes1CommentSSL Certificate error while trying to import swagger definition
I am trying to create a API project by using swagger/Open API definition(Rest) option. I have provided the a correct swagger definition(HTTPS) , but while importing it is throwing an error as "unable to read location '<swagger.json>' due to a SSL configuration error. It is possible that the server SSL certificate is invalid, self-signed, or has an untrusted Certificate Authority." From ready api documentation is saw that we face this issue when the specification is https and followed this solution, but even after doing this i am facing the same error. Can you please provide an alternate solution to this Possible Issues ReadyAPI cannot import OpenAPI 3.0 specifications through HTTPS if the server where your spec resides has an invalid or expired security certificate. To work around this issue: Add the following option to thevmoptionsfile: -Dio.swagger.parser.v3.util.RemoteUrl.trustAll=true Restart ReadyAPI to apply the change.Solved7KViews1like2CommentsParse a multipart/data-form response
Hello all, In my project, I want to assert the content of the reply from my server. I send a POST request containing only a xml file, and I get a multipart/form-data containing 2 parts as a response, as expected. How do I parse those 2 parts of the response in a grovvy script ? The problem is that the "response" property of my Request only contain the first part. The 2nd seems to be lost. Thank you for your support.420Views0likes1CommentSet Authorization Method defaults in Auth Manager which can be inherited by environments
Each of my Ready API projects have dozens of tests and 10+ environments each. The authorization methods for each API request/test is the same across all environments, but any time I need to make changes, or add new requests/tests, I have to open up the environment configuration window. and then for each environment I have to: select the api > Edit > Authorization > Configure > Auth Manager > expand out all of the requests/test steps > make any changes (which is like 3 mouse clicks each plus some scrolling) > close > save And then repeat the exact same steps 10+ more times. Even using inheritance within an environment as much as I can, it's incredibly tedious, and often leads to developers making quick one-off changes in the request/test itself which gets applied inconsistently across environments and then wonder why our automated tests start failing I propose being able to use Auth Manager in the "No Environment" to set the authorization methods in one place, which can then be applied to all environments (unless overridden). Basically, in addition to Inherit From Parent, there could be an Inherit From Default Environment. That way, if an environment will be using all the defaults I only need to touch the environment level auth manager once, set Inherit From Default Environment at the project level for each environment, and then apply that to all dependencies. Any time changes need to be made, I could open up the No Environment Auth Manager, make my changes there, and know it will apply to all all environments inheriting from the default.33Views1like0CommentsRest 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 linkhttps://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 case923Views0likes6CommentsBasic Authentication and Cookie / Session Id
Hello, I am testing Basic Authentication on my Jenkins local server which uses username / password and then Session ID as Cookie. In RAPI, I created a Test Suite -> Test Case -> Login I created an Auth Profile "Jenkins" which has the Authorization set to Basic with the username/password. I attached this profile to the Login Test Case. If I need to preserve the session ID for the next test case, I cannot do so. The documentation suggests enabling the "Maintain the HTTP session" property, which seems to be for a Test Case with multiple Test Steps. Inherit from Parent also does not seem to take the previous session info. The only way to make it work is to reuse the Authorization Profile for every Test Case which is not the way the Application works. Please advise If I missed anything. Thanks9Views0likes0CommentsFailed to update the interface: [ Invalid QName value: Can't resolve prefix 'xs]
Hi, I get this error when trying to update the API definition in the existing project (we use Swagger): Failed to update the interface: [ org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: Invalid QName value: Can't resolve prefix 'xs' ] Full error log: Thu Dec 08 10:12:27 EST 2022: ERROR: org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: Invalid QName value: Can't resolve prefix 'xs' org.apache.xmlbeans.impl.values.XmlValueOutOfRangeException: Invalid QName value: Can't resolve prefix 'xs' at org.apache.xmlbeans.impl.values.JavaQNameHolder.parse(JavaQNameHolder.java:140) at org.apache.xmlbeans.impl.values.JavaQNameHolder.set_text(JavaQNameHolder.java:158) at org.apache.xmlbeans.impl.values.XmlObjectBase.update_from_wscanon_text(XmlObjectBase.java:1180) at org.apache.xmlbeans.impl.values.XmlObjectBase._check_dated(XmlObjectBase.java:1331) at org.apache.xmlbeans.impl.values.XmlObjectBase.check_dated(XmlObjectBase.java:1283) at org.apache.xmlbeans.impl.values.JavaQNameHolder.getQNameValue(JavaQNameHolder.java:185) at com.eviware.soapui.config.impl.RestParameterConfigImpl.getType(Unknown Source) at com.eviware.soapui.impl.rest.support.XmlBeansRestParamsTestPropertyHolder$XmlBeansRestParamProperty.getType(XmlBeansRestParamsTestPropertyHolder.java:462) at com.eviware.soapui.impl.rest.support.XmlBeansRestParamsTestPropertyHolder$XmlBeansRestParamProperty.setType(XmlBeansRestParamsTestPropertyHolder.java:481) at com.eviware.soapui.impl.rest.support.UpdateDefinitionManager.initParam(UpdateDefinitionManager.java:78) at com.eviware.soapui.impl.rest.support.UpdateDefinitionManager.updateParamList(UpdateDefinitionManager.java:170) at com.eviware.soapui.impl.rest.support.UpdateDefinitionManager.updateMethod(UpdateDefinitionManager.java:187) at com.eviware.soapui.impl.rest.support.UpdateDefinitionManager.tryUpdateExistMethod(UpdateDefinitionManager.java:245) at com.eviware.soapui.impl.rest.support.UpdateDefinitionManager.updateMethodList(UpdateDefinitionManager.java:260) at com.eviware.soapui.impl.rest.support.UpdateDefinitionManager.updateResourceNode(UpdateDefinitionManager.java:285) at com.eviware.soapui.impl.rest.support.UpdateDefinitionManager.tryUpdateExistingNode(UpdateDefinitionManager.java:299) at com.eviware.soapui.impl.rest.support.UpdateDefinitionManager.tryUpdateChildResourceNodes(UpdateDefinitionManager.java:317) at com.eviware.soapui.impl.rest.support.UpdateDefinitionManager.updateResourceNodeBase(UpdateDefinitionManager.java:333) at com.eviware.soapui.impl.rest.support.UpdateDefinitionManager.updateDefinition(UpdateDefinitionManager.java:364) at com.eviware.soapui.impl.rest.actions.service.UpdateRESTServiceWizard.perform(UpdateRESTServiceWizard.java:190) at com.eviware.soapui.impl.rest.actions.service.UpdateRESTServiceWizard.perform(UpdateRESTServiceWizard.java:1) at com.eviware.soapui.support.action.swing.SwingActionDelegate.actionPerformed(SwingActionDelegate.java:200) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.AbstractButton.doClick(AbstractButton.java:374) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1028) at java.desktop/javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1072) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389) at java.desktop/java.awt.Component.processEvent(Component.java:6391) at java.desktop/java.awt.Container.processEvent(Container.java:2266) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)Solved1.2KViews0likes4CommentsREST API Definition not updating properly
Hello ! A few months ago we started working on a new definition for our endpoints using stoplight, but the definition went through a lot of different variations as we learned because it was one of the first ones we worked on. In ReadyAPI, I had created test plans using the first version of the definition, and then used the definition updating functionality to update my endpoints. The testing part works properly, however when I want to use the project coverage, my responses all show as 1/1 covered with no content in the message coverage window, and when I look into the "Specification" window I can see that it's not consistent with the new definition .json file. Using "definition refactoring" also does not correct the problem. Importing the definition .json file into a fresh project will create a proper service with the right specifications and unlock the ability to use project coverage, but it will be difficult to adapt transfer all the tests manually to a new service. For example, in the old updated/refactored service I would have : "responses" : { "200" : { "description" : "OK", "content" : { "application/json" : { "example" : "" } } }, } and in the freshly create service with the same definition file I would have : "responses" : { "200" : { "description" : "OK", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/PlaceholderAPIBR" } } } }, } Is there a way to update the old service API with the new definition and force it to use the new response format ? The definition file also changed location and name when we started sourcing the project using Git, but I can see that the "original definition path" in the specification window and the "definition" service property are still showing the old file path. I'd rather not have to change all the tests, considering the main ReadyAPI project consume multiple services and not all of them have the issue.84Views0likes1CommentFetch Access token using OAutho0.2 - Implicit Grant
Hi, I have scenario to test ready api but that works when AccessToken is entered. So till now i have managed by entering the access token in below UI by fetching it from Access Token from UI I tried Implicit Grant but here when i click on get Access Token an UI will appear . I have written automation code in Autho Mangr-> automation code to click on Autho Selector type . But i can see it does not work at all. Here, i want to know how can i get the access token using implicit grant or is there anyother way where i can launch chrome browser and select ADFS-> Click login and ->Copy the Access token and save it into and variable and pass it into above Access Token textbox. Note - I decided to go with Implicit Grant because client is not okay to share client-ID33Views0likes0CommentsHTTP/1.1 404 Not Found error for a GET request in ReadyAPI but same works in Postman
I am getting "HTTP/1.1 404 Not Found' error for a GET request in ReadyAPI but same works in Postman. I can also hit the exact same endpoint using Python script Has anybody faced similar issue?Solved100Views0likes1Comment