Contributions
How to run a property of teststep DataGen?
Hello, Is it possible to run a Script Property of a DataGen-step from another Script Property? So yes, how do you do that? By example: - DataGen has the properties "Property_1" and "Property_2" - inside the code of "Property_1", I will run "Property_2" Best regards, Benny519Views0likes0CommentsRe: howto save response while saving SoapUI project
Hi Arun, You can use following script to save your response to a xml-file. def File = New PrintWriter ("C:/.../response.xml") def Response = testRunner.testCase.testSteps["aaa"].testRequest.response.contentAsString File.println(Response) File.flush() File.close() "aaa" reflect to the name of your test step Test Request. Regards, Benny5KViews0likes0CommentsDatasource - JDBC - read in value of xml-type
Hi, I'm trying to read a field of a table who has the value of a xml-type. My driver and connection string are correctely filled in. It is possible to read other fields (ex: select BALANCEOBJECTID from MOB_FU_CATALOG_B where BALANCEOBJECTID = 'BSCS24432443' --> BSCS24432443) For the field (xmlchunk) with the xml-type, I use this statement: select extract(XMLCHUNK,'/').getStringVal() from MOB_FU_CATALOG_B where BALANCEOBJECTID = 'BSCS24432443' For the tool Oracle SQL+, it works and give me this result: SQL> select extract(XMLCHUNK,'/').getStringVal() from MOB_FU_CATALOG_B where BALANCEOBJECTID = 'BSCS 24432443'; EXTRACT(XMLCHUNK,'/').GETSTRINGVAL() -------------------------------------------------------------------------------- tp://mobistar.be/Common/v1" xmlns:fra="http://mobistar.be/Framework/v1" xmlns:ow n="http://mobistar.be/own" xmlns:pro="http://mobistar.be/Customer/ProductDefinit ion/v1" xmlns:qua="http://mobistar.be/Common/Quantity/v1" xmlns:xsi="http://www. w3.org/2001/XMLSchema-instance"> BSCS24432443 > BalanceDefinition uagestrings> My10 F R My10 om1:String> EN string> My10 NL nguagestring> My10 EXTRACT(XMLCHUNK,'/').GETSTRINGVAL() -------------------------------------------------------------------------------- DE Bundle <> ConsumptionMetric>Monetary <> Metric>Monetary 8.2645 BaseC urrency 8.26 al> Contract true itialAmount> 0 <> AmountUnit/> T> 8.2645 EXTRACT(XMLCHUNK,'/').GETSTRINGVAL() -------------------------------------------------------------------------------- nt/> 21 My10 My10 wn:label lang="de">My10 My10 ority>45 When I run the datasource, it gives me a blanco value. The soapUI-log tells me that he got 1 row (Wed Apr 15 14:50:57 CEST 2009:INFO:Got 1 columns from resultset). Can someone help me with this problem? Regards, Benny2.1KViews0likes2CommentsRe: NullPointerException when use runTestStepByName() for DataSink
Hi Ole, Yes, that is correct. I have make yesterday some tests, and I have discovered that the error is thrown at the end of the script. But I don't know the reason. But the runTestStepByName() for the DataSink seems not to be working. The icon (of DataSink in the Navigator-panel) colors red after the script has run. Than I can see that the (last) values are well filled in in the properties of the DataSink, but the synchronisation is not happened. So, the script runs not completely. regards, Benny1.3KViews0likes0CommentsRe: NullPointerException when use runTestStepByName() for DataSink
Hi, The purpose of the script is the following. It's read the response, and catch al the data and write it to a Properties-step. Than I run the Property Transfer and the DataSink, so that the data will write out in a Excel-file. The response has a few standard topics, who will return several times. But I don't know how many times. That's why I use the while-loop. So here is the entire script. def a="true" def teller=0 def teststep="" def inputFcli="" def inputFileDate="" def inputCreateDate="" def inputLoadDate="" def inputStatus="" def inputBillcycleStartDate="" def inputBillcycleEndDate="" def inputPrice="" def inputConso="" def inputIncludedVolume="" def inputUsedVolume="" //aanmaken teststep properties testRunner.testCase.addTestStep("properties","Objects") teststep=testRunner.testCase.getTestStepByName("Objects") teststep.addProperty('Fcli') teststep.addProperty('FileDate') teststep.addProperty('CreateDate') teststep.addProperty('LoadDate') teststep.addProperty('Status') teststep.addProperty('BillcycleStartDate') teststep.addProperty('BillcycleEndDate') teststep.addProperty('Price') teststep.addProperty('Conso') teststep.addProperty('IncludedVolume') teststep.addProperty('UsedVolume') while (a=="true"){ teller++ inputFcli=context.expand( '${GetADSLConsumption#Response#//ns2:GetADSLConsumptionResponse[1]/ADSLConsumptionBundle['+teller+']/fcli[1]}' ) if (inputFcli!=""){ //inlezen van response inputFileDate = context.expand( '${GetADSLConsumption#Response#//ns2:GetADSLConsumptionResponse[1]/ADSLConsumptionBundle['+teller+']/filedate[1]}' ) inputCreateDate = context.expand( '${GetADSLConsumption#Response#//ns2:GetADSLConsumptionResponse[1]/ADSLConsumptionBundle['+teller+']/createdate[1]}' ) inputLoadDate = context.expand( '${GetADSLConsumption#Response#//ns2:GetADSLConsumptionResponse[1]/ADSLConsumptionBundle['+teller+']/loaddate[1]}' ) inputStatus = context.expand( '${GetADSLConsumption#Response#//ns2:GetADSLConsumptionResponse[1]/ADSLConsumptionBundle['+teller+']/status[1]}' ) inputBillcycleStartDate = context.expand( '${GetADSLConsumption#Response#//ns2:GetADSLConsumptionResponse[1]/ADSLConsumptionBundle['+teller+']/billcyclestartdate[1]}' ) inputBillcycleEndDate = context.expand( '${GetADSLConsumption#Response#//ns2:GetADSLConsumptionResponse[1]/ADSLConsumptionBundle['+teller+']/billcycleenddate[1]}' ) inputPrice = context.expand( '${GetADSLConsumption#Response#//ns2:GetADSLConsumptionResponse[1]/ADSLConsumptionBundle['+teller+']/price[1]}' ) inputConso = context.expand( '${GetADSLConsumption#Response#//ns2:GetADSLConsumptionResponse[1]/ADSLConsumptionBundle['+teller+']/conso[1]}' ) inputIncludedVolume = context.expand( '${GetADSLConsumption#Response#//ns2:GetADSLConsumptionResponse[1]/ADSLConsumptionBundle['+teller+']/includedvolume[1]}' ) inputUsedVolume = context.expand( '${GetADSLConsumption#Response#//ns2:GetADSLConsumptionResponse[1]/ADSLConsumptionBundle['+teller+']/usedvolume[1]}' ) //response wegschrijven naar properties file testRunner.testCase.getTestStepByName("Objects").setPropertyValue('Fcli', inputFcli) testRunner.testCase.getTestStepByName("Objects").setPropertyValue('FileDate', inputFileDate) testRunner.testCase.getTestStepByName("Objects").setPropertyValue('CreateDate', inputCreateDate) testRunner.testCase.getTestStepByName("Objects").setPropertyValue('LoadDate', inputLoadDate) testRunner.testCase.getTestStepByName("Objects").setPropertyValue('Status', inputStatus) testRunner.testCase.getTestStepByName("Objects").setPropertyValue('BillcycleStartDate', inputBillcycleStartDate) testRunner.testCase.getTestStepByName("Objects").setPropertyValue('BillcycleEndDate', inputBillcycleEndDate) testRunner.testCase.getTestStepByName("Objects").setPropertyValue('Price', inputPrice) testRunner.testCase.getTestStepByName("Objects").setPropertyValue('Conso', inputConso) testRunner.testCase.getTestStepByName("Objects").setPropertyValue('IncludedVolume', inputIncludedVolume) testRunner.testCase.getTestStepByName("Objects").setPropertyValue('UsedVolume', inputUsedVolume) //automatisch uitvoeren van teststeps testRunner.runTestStepByName("Property Transfer") testRunner.runTestStepByName("DataSink") } else { a="false" } } Regards, Benny1.3KViews0likes0CommentsNullPointerException when use runTestStepByName() for DataSink
Hi, I was trying to run my teststep "DataSink" automatic by the groovy-script: testRunner.runTestStepByName("DataSink") But it creates an the following error: Mon Jan 26 14:33:06 CET 2009:ERROR:java.lang.NullPointerException java.lang.NullPointerException at com.eviware.soapui.support.xml.XmlUtils.getValueForMatch(XmlUtils.java:1090) at com.eviware.soapui.model.propertyexpansion.resolvers.ResolverUtils.extractXPathPropertyValue(ResolverUtils.java:92) at com.eviware.soapui.model.propertyexpansion.resolvers.ModelItemPropertyResolver.resolveProperty(ModelItemPropertyResolver.java:81) at com.eviware.soapui.model.propertyexpansion.PropertyExpansionUtils.expandProperties(PropertyExpansionUtils.java:143) at com.eviware.soapui.model.propertyexpansion.PropertyExpansionUtils.expandProperties(PropertyExpansionUtils.java:98) at com.eviware.soapui.model.support.AbstractSubmitContext.expand(AbstractSubmitContext.java:245) at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:230) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:912) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:756) at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:766) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:754) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:170) at Script6.run(Script6.groovy:15) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:59) at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:52) at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148) at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction.actionPerformed(GroovyScriptStepDesktopPanel.java:235) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) The fact is the values of the property list (of DataSink) are well filled in and when I will run it afterwards manual, it is no problem. Is this the right way to do this in Groovy? Or are there other solutions for this?2.7KViews0likes4Comments