How to create html file in groovy script and how to use dynamic values from response to html code
How to create html file in groovy script and how to use dynamic values from response to html code Basic HTML code in groovy will be little helpful for me and dynamically need to change value in html code which I will get from API responses Please respond anything is fine Thanks in advance AlexKaras Marsha_R @richieSolved8.1KViews0likes7CommentsProperty Transfer failed when run through maven maven build
hello everyone! I need your quick help. I have a problem when i run my little SoapUI Project with cmd (Winodws 10 & SoapUI Verison 5.6.0). My project consists of two calls, where from the response of the first call an attribute into the second call. When I run the test case in SoapUI everything works fine. Now I have saved the project as XML and included it in the build process of my POM. When I start the project via cmd, it also runs the first call and recognizes it as valid. But when the property transfer is pending, it gives the following error: 11:00:43,526 INFO [SoapUITestCaseRunner] running step [Property Transfer] java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.lang.Object.finalize() throws java.lang.Throwable accessible: module java.base does not "opens java.lang" to unnamed module @20890a1a at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) at java.base/java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:130) at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java:86) at java.base/java.security.AccessController.doPrivileged(AccessController.java:312) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:81) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:116) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:116) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.reflection.stdclasses.CachedClosureClass.<init>(CachedClosureClass.java:29) at org.codehaus.groovy.reflection.ClassInfo.createCachedClass(ClassInfo.java:269) at org.codehaus.groovy.reflection.ClassInfo.access$400(ClassInfo.java:36) at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:435) at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:426) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.ClassInfo.getCachedClass(ClassInfo.java:89) at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:107) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:189) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:93) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:71) at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33) at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:62) at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32) at net.sf.json.groovy.JsonSlurper.<init>(JsonSlurper.java:46) at net.sf.json.groovy.JsonSlurper.<init>(JsonSlurper.java:43) at com.eviware.soapui.support.JsonUtil.isValidJson(JsonUtil.java:32) at com.eviware.soapui.support.JsonPathFacade.<init>(JsonPathFacade.java:37) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer.readSourceValue(PropertyTransfer.java:347) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer.transferProperties(PropertyTransfer.java:317) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep.run(PropertyTransfersTestStep.java:125) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep.run(PropertyTransfersTestStep.java:103) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:129) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:831) 11:00:44,278 ERROR [AbstractTestRunner] Exception during Test Execution java.lang.ExceptionInInitializerError at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:62) at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32) at net.sf.json.groovy.JsonSlurper.<init>(JsonSlurper.java:46) at net.sf.json.groovy.JsonSlurper.<init>(JsonSlurper.java:43) at com.eviware.soapui.support.JsonUtil.isValidJson(JsonUtil.java:32) at com.eviware.soapui.support.JsonPathFacade.<init>(JsonPathFacade.java:37) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer.readSourceValue(PropertyTransfer.java:347) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfer.transferProperties(PropertyTransfer.java:317) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep.run(PropertyTransfersTestStep.java:125) at com.eviware.soapui.impl.wsdl.teststeps.PropertyTransfersTestStep.run(PropertyTransfersTestStep.java:103) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138) at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46) at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:129) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:831) Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected void java.lang.Object.finalize() throws java.lang.Throwable accessible: module java.base does not "opens java.lang" to unnamed module @20890a1a at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) at java.base/java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java:130) at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java:86) at java.base/java.security.AccessController.doPrivileged(AccessController.java:312) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:81) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:116) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:116) at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79) at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46) at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33) at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:211) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:101) at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:71) at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:33) ... 20 more 11:00:44,331 INFO [SoapUITestCaseRunner] Finished running SoapUI testcase [TestCase - Symptom], time taken: 487ms, status: FAILED 11:00:44,333 INFO [SoapUITestCaseRunner] Project [Project 1] finished with status [FAILED] in 1602ms [ERROR] java.lang.Exception: TestCase [TestCase - Symptom] failed without assertions I also have a sample project without property transfer and everything runs without errors when I start it via the cmd, so it can really only be the property transfer. Have any of you ever had this problem? I really need your help!Solved6.8KViews0likes4CommentsCreating a custom Delay teststep via a Groovy scripting step
I managed to create a custom Delay test step via Groovy script but I can't seem to modify the step. def stepName = "DelayTimeWindow" def newPropertiesStep = testCase.getTestStepByName(stepName) if (newPropertiesStep == null) { newPropertiesStep = testCase.addTestStep('delay', stepName) } I can't seem to modify the actual delay value (in milliseconds) nor am I able to disable the test step from the normal sequential execution of the test case after I create it via code. I need to be able to set up a dynamic delay based on a value set by the 'main' script I have in the test case. The custom delay step is needed to be called by another (disabled) test step which is triggered by the 'main' test step calling it via therunTestStepByName() function. I've tried to use Thread.sleep() but it seems to have messed up the whole test case when it woke up after that sleep(). I wasn't even getting proper logging info on the script log window at the bottom of the screen after that. The test case contains multiple test steps that are all in the disabled state and only called via one main, active Groovy test step depending on multiple variables from an input spreadsheet and many of the test steps are being reused throughout the execution of the test case.Solved3.5KViews0likes8CommentsIs there any way to read different project properties in groovy through soap ui
I am preparing summary report for my soap ui project but in have more than 3 projects but not sure how to read /get the total test case ,passed count from each project suite and make consolidated report ?? Currently I have individual project reports but need help on this part, do I need to use global property?Solved3.2KViews0likes6CommentsReports view option is not available in test case editor. We are using soap UI 5.5 and soap UI 5.6
Hi, I am newbie in REST API testing. I have a query on reports. We are using soap UI 5.6 version. In test case editor, there is no option as "Reports". I verified in couple of forums. i am seeing some extra feature called "reports" is displayed in test case editor. But i am not getting the "Reports" Option in test case editor. could you please let me know anything need to change in settings of the tool. Thanks.Solved1.9KViews0likes3Commentsget property value of a test case's step when this test case is called from another test case
Hi Guys. I am new to SoapUI tool and trying to setup a framework from scratch. I am using SoapUI for an end to end testing rather than API response validation. So, as part of framework, I have setup it in such a way: Suite1: > TC1 > TC2 Suite2: > TC3 > TC4 Generic: (This suite contains generic reusable tests which can be called in Suite1&2) > loginToApp > createAccounts > fetchAccountDetails I am creating a new custom report to report the execution detail of each step in extent report. I have used the test suite teardown script option to create a custom file for now. The issue is: when I am trying to fetch response and request properties of my callable methods, they always return as Null. So I am not able to write them in my custom file. This is my script below: runner.results.each{ testCaseRunner -> log.info 'test case name:'+testCaseRunner.testCase.name testcase_logger = testsuite_logger.createNode(testCaseRunner.testCase.name); testCaseRunner.results.each{testStepRunner-> def testStep=testStepRunner.testStep log.info 'Config'+testStep.config log.info 'Type'+testStep.config.type if(testStep.config.type.toString().equals('calltestcase')) { def callableTest=testStep.targetTestCase def callableTestName=callableTest.name log.info 'callable test name--'+callableTestName callableTest.getTestStepList().each{callableTestStep-> log.info 'callable step name---'+callableTestStep.name log.info 'callable step type---'+callableTestStep.config.type for(testProperty in callableTest.getTestStepByName(callableTestStep.name).getPropertyList()){ if(testProperty.isReadOnly()){ log.info( 'Output property: ' + testProperty.getName() + ' = ' + testProperty.getValue()) }else{ log.info( 'Input property: ' + testProperty.getName() + ' = ' + testProperty.getValue()) } } I have printed all the properties but request and response are always null. Can anyone guide me on how to fetch request and response from the callable test step's response when the callable testcase is part of another testsuite?1.7KViews0likes3CommentsError Code creating JUnit Report
I wanna create a JUnit Test report with Apache Ant (I use the free version of Soap UI). The problem I have is when I enter the command in the cmd I get following error: [exec] SoapUI 5.5.0 TestCase Runner [exec] usage: testrunner [options] <soapui-project-file> [exec] -A Turns on exporting of all results using folders instead of [exec] long filenames [exec] -a Turns on exporting of all results [exec] -c <arg> Sets the testcase [exec] -D <arg> Sets system property with name=value [exec] -d <arg> Sets the domain [exec] -e <arg> Sets the endpoint [exec] -f <arg> Sets the output folder to export results to [exec] -G <arg> Sets global property with name=value [exec] -H <arg> Adds a custom HTTP Header to all outgoing requests [exec] (name=value), can be specified multiple times [exec] -h <arg> Sets the host [exec] -I Do not stop if error occurs, ignore them [exec] -i Enables Swing UI for scripts [exec] -J Sets the output to include JUnit XML reports adding test [exec] properties to the report [exec] -j Sets the output to include JUnit XML reports [exec] -M Creates a Test Run Log Report in XML format [exec] -m Sets the maximum number of TestStep errors to save for each [exec] testcase [exec] -P <arg> Sets or overrides project property with name=value [exec] -p <arg> Sets the password [exec] -r Prints a small summary report [exec] -S Saves the project after running the tests [exec] -s <arg> Sets the testsuite [exec] -t <arg> Sets the soapui-settings.xml file to use [exec] -u <arg> Sets the username [exec] -v <arg> Sets password for soapui-settings.xml file [exec] -w <arg> Sets the WSS password type, either 'Text' or 'Digest' [exec] -x <arg> Sets project password for decryption if project is encrypted [exec] Missing SoapUI project file.. [exec] Result: -1 I tried to do file in the orderer where the reporst should be created but still get the same error. Does anyone know how to fix that? Best regards, Jan1.4KViews0likes1CommentSoapUI testrunner ERROR com.eviware.soapui.SoapUI - An error occurred [Unrecognized option: -F]
I am configuring my testrunner command line per the instructions in https://www.soapui.org/test-automation/running-from-command-line/functional-tests.html I'm getting an error. Is the page linked above correct for SoapUI 5.5.0 testrunner? Note: I have tried with and without a space between the option "-F" and the style "XML", i.e.: -F XML -FXML How can I fix this? /usr/platform/SoapUI-5.5.0/bin/testrunner.sh -I -j -f output -F XML -a -Gnode1=linuxhost1 -Gnode2=linuxhost2 -s 'Smoke Test Launch TestSuite' 5010-837-Smoke-Test-Project-soapui-project.xml ================================ = = SOAPUI_HOME = /usr/platform/SoapUI-5.5.0 = ================================ SoapUI 5.5.0 TestCase Runner 2020-04-17 13:03:13,770 [main] ERROR com.eviware.soapui.tools.SoapUITestCaseRunner - org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: -F 2020-04-17 13:03:13,771 [main] ERROR com.eviware.soapui.SoapUI - An error occurred [Unrecognized option: -F], see error log for details 2020-04-17 13:03:13,771 [main] ERROR soapui.errorlog - org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: -F org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: -F at org.apache.commons.cli.Parser.processOption(Parser.java:363) at org.apache.commons.cli.Parser.parse(Parser.java:199) at org.apache.commons.cli.Parser.parse(Parser.java:85) at com.eviware.soapui.tools.AbstractSoapUIRunner.initFromCommandLine(AbstractSoapUIRunner.java:151) at com.eviware.soapui.tools.AbstractSoapUIRunner.validateCommandLineArgument(AbstractSoapUIRunner.java:120) at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:111) at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:122) org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: -F at org.apache.commons.cli.Parser.processOption(Parser.java:363) at org.apache.commons.cli.Parser.parse(Parser.java:199) at org.apache.commons.cli.Parser.parse(Parser.java:85) at com.eviware.soapui.tools.AbstractSoapUIRunner.initFromCommandLine(AbstractSoapUIRunner.java:151) at com.eviware.soapui.tools.AbstractSoapUIRunner.validateCommandLineArgument(AbstractSoapUIRunner.java:120) at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:111) at com.eviware.soapui.tools.SoapUITestCaseRunner.main(SoapUITestCaseRunner.java:122)1.4KViews0likes1Comment