Groovy script for dynamic response in Readyapi
Our scope of need is to get a dynamic response if the user hits the API request incorrectly and they need to get different response. I have created in readyapi rest, soap, and jdbc protocols with static responses when the user wants to access the response, but when the user requests with payload incorrectly example ( wrong I'd -xxxxx) , they receive the same response from readyAPI. I would like to create script to handle dynamic response; could you please share an example?Solved190Views0likes3CommentsTest step for a request with multiple values at different positions in the request
Hello everyone, So far, I've been use to set multi values for the same parameter by separating them with a ";" in the parameters setting (https://support.smartbear.com/readyapi/docs/requests/rest/parameters.html). However, by using this, the 2 values are near to each other in the request. How could I set 2 different values for the same parameter, when one of them must be at the beginning of a long request, and the second at the end of the request? Regards176Views0likes1CommentProblems with publishing API from war file
Hello everyone. Recently i started to play arround with SoapUI and later also with ReadyAPI. I quickly set up sonarqube server and was able to create Virtual Service based on some few requests. I disabled the sonarqube and tried to use the service alone - it worked as expected. Then i exported this service as WAR file. And tried to publish it with tomcat docker server. But i keep getting this error and when i go to browser i get 404 version: '3.9' version: '3.9' services: tomcat: image: tomcat:8 container_name: tomcat volumes: - "/mnt/c/PROJECTS/TMNA/soapui-war/war:/usr/local/tomcat/webapps" ports: - "8888:8080" $ docker logs tomcat NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED 06-Oct-2023 09:03:34.951 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/8.5.93 06-Oct-2023 09:03:34.953 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Aug 23 2023 22:43:14 UTC 06-Oct-2023 09:03:34.953 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.93.0 06-Oct-2023 09:03:34.953 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux 06-Oct-2023 09:03:34.953 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 5.10.102.1-microsoft-standard-WSL2 06-Oct-2023 09:03:34.953 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /opt/java/openjdk 06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 17.0.8.1+1 06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Eclipse Adoptium 06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat 06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat 06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED 06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED 06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED 06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED 06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED 06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties 06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs= 06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat 06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat 06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp 06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.38] using APR version [1.7.0]. 06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [{4}]. 06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 06-Oct-2023 09:03:34.959 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 3.0.2 15 Mar 2022] 06-Oct-2023 09:03:34.986 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"] 06-Oct-2023 09:03:35.007 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 335 ms 06-Oct-2023 09:03:35.029 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 06-Oct-2023 09:03:35.029 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/8.5.93] 06-Oct-2023 09:03:35.047 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/soap.war] 06-Oct-2023 09:03:35.064 INFO [localhost-startStop-1] org.apache.catalina.startup.ExpandWar.expand An expanded directory [/usr/local/tomcat/webapps/soap] was found with a last modified time that did not match the associated WAR. It will be deleted. 06-Oct-2023 09:04:21.937 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@59c08549] at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:130) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:161) at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:696) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4554) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4692) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:710) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:687) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:661) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1016) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1903) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: java.lang.IllegalArgumentException: java.io.IOException: java.lang.reflect.InvocationTargetException at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:127) ... 16 more Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException at org.apache.tomcat.util.compat.Jre9Compat.jarFileNewInstance(Jre9Compat.java:209) at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:241) at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:137) ... 17 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at org.apache.tomcat.util.compat.Jre9Compat.jarFileNewInstance(Jre9Compat.java:206) ... 19 more Caused by: java.util.zip.ZipException: zip END header not found at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1633) at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1641) at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1479) at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1441) at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:718) at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:252) at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:181) at java.base/java.util.jar.JarFile.<init>(JarFile.java:346) ... 24 more 06-Oct-2023 09:04:21.938 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/usr/local/tomcat/webapps/soap.war] java.lang.IllegalStateException: Error starting child at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:714) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:687) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:661) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1016) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1903) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@59c08549] at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:130) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:161) at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:696) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4554) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4692) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:710) ... 9 more Caused by: java.lang.IllegalArgumentException: java.io.IOException: java.lang.reflect.InvocationTargetException at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:127) ... 16 more Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException at org.apache.tomcat.util.compat.Jre9Compat.jarFileNewInstance(Jre9Compat.java:209) at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:241) at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:137) ... 17 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at org.apache.tomcat.util.compat.Jre9Compat.jarFileNewInstance(Jre9Compat.java:206) ... 19 more Caused by: java.util.zip.ZipException: zip END header not found at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1633) at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1641) at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1479) at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1441) at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:718) at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:252) at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:181) at java.base/java.util.jar.JarFile.<init>(JarFile.java:346) ... 24 more 06-Oct-2023 09:04:21.941 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/soap.war] has finished in [46,894] ms 06-Oct-2023 09:04:21.944 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"] 06-Oct-2023 09:04:21.951 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 46943 ms I tried with latest, 9 and 8 versions of tomcat I also exported UI to SoapUI. Again - it worked inside the application but .war file did not work. BTW: Your documentation lacks some basic information. Like i was really confused that i could not find any option related to "Discover API" in SoapUI. For example please take a look on gitlab's documentation - each topic has tags indicating which version (free, paid, cloud etc) particular section is applicable to.371Views0likes0CommentsIntercepting the response(from the actual host) in virtual service to verify if its a negative
Here is my scenario: Create a virtual service that forwards the incoming request to the actual host (always) , Upon receiving the response from actual host, then my virtual service should be able to intercept the response from actual host. Review the response for any errors. If there are errors then return a default(positive) response from within the virtual service. Is this possible to do with service virtualization(readyAPI). If its possible, what options I can go with ?Solved419Views1like3CommentsWhy I dont see GraphQL tab in Endpoints& Environment Section in ReadyAPI?
Why I dont see GraphQL tab in Endpoints& Environment Section in ReadyAPI? We are using 3 different ReadyAPI licenses that supports virtualization, Functional Test, Performance Testing. When looking for GraphQL tab under Endpoints and Environment section to support Functional/Performance testing of GraphQL, we do not see GraphQL tab? do we need to have any additional license for it? can we do GraphQL endpoint validation without this tab? are there any video/webinar links that demo GraphQL endpoint functional/performance testing. Thank you!317Views1like1Commentvirtual server : validate client sends request 10s after sending first request
I created 2 endpoints for a virtual service (/a and /b) After client sends request to endpoint /a, I need to verify that after 10 seconds client sends a request to endpoint /b. Is there a way to do this in readyapi? I used the onRequest script in the virtual service to validate request body of request sent to /a but how do I verify that after 10 seconds request is sent to /b ?270Views0likes0CommentsOutgoing Message Naming
In my project, we have around 250 outgoing responses to the virtualized service. We captured those responses by using "Data Source Loop" but, the outgoing responses are saved as "Response1, Response 2, Response3.........." but, we want the naming convention of these responses based on the data source values. Is there any way to name those responses while capturing them.413Views0likes1Comment