Contributions
Re: How I add HTTP headers to all HTTP requests in a project,
When you mention multiple iteration how do we do that? Why can't I simply do this import com.eviware.soapui.support.types.StringToStringMap def headers = new StringToStringMap() headers.put("Cookie","XSRF-TOKEN=soap;") headers.put("X-XSRF-TOKEN","soap") def testCases = testRunner.testCase List name = new ArrayList(); testCases.each { for(testStep in it.testStepList) { log.info "~~~Test Step:" + testStep.name name.add(testStep.name); } } for(int i=0;i<name.size();i++){ testRunner.testCase.getTestStepByName(name.get(i)).testRequest.setRequestHeaders(headers) } When I iterate over the testStep if I can get the name why ca't I update the headers also?9.9KViews0likes1CommentRe: How I add HTTP headers to all HTTP requests in a project,
Using this code I can print each step name, But now how do I add the headers? import com.eviware.soapui.support.types.StringToStringMap def headers = new StringToStringMap() headers.put("Cookie","XSRF-TOKEN=soap;") headers.put("X-XSRF-TOKEN","soap") def testCases = testRunner.testCase testCases.each { for(testStep in it.testStepList) { log.info "~~~Test Step:" + testStep.name //testStep.testRequest.setRequestHeaders(headers) } }10KViews0likes1CommentHow I add HTTP headers to all HTTP requests in a project,
We have SOAP UI 5.1.1, and we have a SOAP test project and a REST test project in it. We have a bunch of HTTP requests in the SOAP project and all the requests in the REST Test project need new HTTP headers. If there any script which will add these headers to all my requests , versus me having to do it manually?10KViews0likes7CommentsFailure when trying to automate running of tests
Trying to automate the running of our test suites on a Linux box... I'm at the point where the tests are copied to the correct folder and I'm ready to call out to run the test runner via a shell script with the command: /root/ReadyAPI-1.1.0/bin/testrunner.sh -f"./SOAPUI_REPORTS/REST-Testing" -R"TestCase Report" -j -r -F PDF "./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml" The ConfiguringRepositories project is a composite project, created with SoapUIPro 5.1. The soapui.log file shows: 2015-01-23 10:42:25,713 INFO [SoapUI] Adding [/root/ReadyAPI-1.1.0/bin/ext/sqljdbc41.jar] to extensions classpath 2015-01-23 10:42:26,094 INFO [DefaultSoapUICore] initialized soapui-settings from [/root/soapui-settings.xml] 2015-01-23 10:42:26,339 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [/root/SOAPUI/bin/scripts] 2015-01-23 10:42:26,341 INFO [DefaultSoapUICore] Adding listeners from [/root/ReadyAPI-1.1.0/bin/listeners/demo-listeners.xml] 2015-01-23 10:42:27,549 INFO [PluginLoader] 0 plugins loaded in 0 ms 2015-01-23 10:42:27,549 INFO [DefaultSoapUICore] All plugins loaded 2015-01-23 10:42:28,542 ERROR [SoapUI] An error occurred [Failed to load project from file [file:/root/v10panda/qa_automation/NightlyAutomatedSoapUiTesting/./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml]], see error log for details 2015-01-23 10:42:28,543 ERROR [errorlog] com.eviware.soapui.support.SoapUIException: Failed to load project from file [file:/root/v10panda/qa_automation/NightlyAutomatedSoapUiTesting/./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml] com.eviware.soapui.support.SoapUIException: Failed to load project from file [file:/root/v10panda/qa_automation/NightlyAutomatedSoapUiTesting/./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml] at com.eviware.soapui.impl.wsdl.WsdlProjectPro.loadProject(WsdlProjectPro.java:329) at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:236) at com.eviware.soapui.impl.wsdl.WsdlProjectPro.<init>(WsdlProjectPro.java:168) at com.eviware.soapui.impl.wsdl.WsdlProjectProFactory.createNew(WsdlProjectProFactory.java:28) at com.eviware.soapui.impl.wsdl.WsdlProjectProFactory.createNew(WsdlProjectProFactory.java:1) at com.smartbear.ready.cmd.runner.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:331) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.runRunner(SoapUIProTestCaseRunner.java:90) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:215) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:138) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.init(SoapUIProTestCaseRunner.java:72) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.main(SoapUIProTestCaseRunner.java:67) Caused by: org.apache.xmlbeans.XmlException: Element testCase@http://eviware.com/soapui/config is not a valid soapui-project@http://eviware.com/soapui/config document or a valid substitution. at org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:328) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1279) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1263) at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345) at com.eviware.soapui.config.SoapuiProjectDocumentConfig$Factory.parse(Unknown Source) at com.eviware.soapui.impl.wsdl.WsdlProjectPro.loadProject(WsdlProjectPro.java:201) ... 10 more 2015-01-23 10:42:28,647 ERROR [SoapUIProTestCaseRunner] java.lang.Exception: Failed to load project file [./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml] 2015-01-23 10:42:28,647 ERROR [SoapUI] An error occurred [Failed to load project file [./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml]], see error log for details 2015-01-23 10:42:28,647 ERROR [errorlog] java.lang.Exception: Failed to load project file [./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml] java.lang.Exception: Failed to load project file [./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml] at com.smartbear.ready.cmd.runner.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:335) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.runRunner(SoapUIProTestCaseRunner.java:90) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:215) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:138) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.init(SoapUIProTestCaseRunner.java:72) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.main(SoapUIProTestCaseRunner.java:67) and the soapui-errors.log file shows: 2015-01-23 10:42:28,543 ERROR [errorlog] com.eviware.soapui.support.SoapUIException: Failed to load project from file [file:/root/v10panda/qa_automation/NightlyAutomatedSoapUiTesting/./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml] com.eviware.soapui.support.SoapUIException: Failed to load project from file [file:/root/v10panda/qa_automation/NightlyAutomatedSoapUiTesting/./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml] at com.eviware.soapui.impl.wsdl.WsdlProjectPro.loadProject(WsdlProjectPro.java:329) at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:236) at com.eviware.soapui.impl.wsdl.WsdlProjectPro.<init>(WsdlProjectPro.java:168) at com.eviware.soapui.impl.wsdl.WsdlProjectProFactory.createNew(WsdlProjectProFactory.java:28) at com.eviware.soapui.impl.wsdl.WsdlProjectProFactory.createNew(WsdlProjectProFactory.java:1) at com.smartbear.ready.cmd.runner.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:331) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.runRunner(SoapUIProTestCaseRunner.java:90) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:215) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:138) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.init(SoapUIProTestCaseRunner.java:72) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.main(SoapUIProTestCaseRunner.java:67) Caused by: org.apache.xmlbeans.XmlException: Element testCase@http://eviware.com/soapui/config is not a valid soapui-project@http://eviware.com/soapui/config document or a valid substitution. at org.apache.xmlbeans.impl.store.Locale.autoTypeDocument(Locale.java:328) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1279) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1263) at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345) at com.eviware.soapui.config.SoapuiProjectDocumentConfig$Factory.parse(Unknown Source) at com.eviware.soapui.impl.wsdl.WsdlProjectPro.loadProject(WsdlProjectPro.java:201) ... 10 more 2015-01-23 10:42:28,647 ERROR [errorlog] java.lang.Exception: Failed to load project file [./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml] java.lang.Exception: Failed to load project file [./projects/REST-API/Repositories-TestSuite-4f19b136-5740-44ac-be10-a0427b18a846/ConfiguringRepositories-4fe4bfd9-7beb-4574-990e-e994fff7d426.xml] at com.smartbear.ready.cmd.runner.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:335) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.runRunner(SoapUIProTestCaseRunner.java:90) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:215) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:138) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.init(SoapUIProTestCaseRunner.java:72) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.main(SoapUIProTestCaseRunner.java:67) I have no idea what to look for now? The other issue --- and maybe the main issue --- is that we have a settings.xml file that has some Event coding in there that setups the environment. Do I need to run that one first or is it implicitly loaded? Update - I can run the settings.xml file, but I can't tell if it actually did anything or not. When I do the next line in the script (ie, running the test suite), I get the above errors. Thanks, Aaron10 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes3CommentsSoap call strips parameter from macro
I am using SoapUI-Pro to send a soap call to our application for testing purposes. The format of the xml data is: <SOAP-ENV:Body> ... <value>#FormatStringDate(${ReportDate},"MM/dd/yyyy")</value> ... </SOAP-ENV:Body> The macro #FormatStringDate is used in our application with the two parameters that are passed in. The application will replace ${ReportDate} with the appropriate data and configure it according to the format string "MM/dd/yyyy" passed in along with it. However, when using SoapUI-Pro to make this web service call, the actual string that gets sent to our application is: #FormatStringDate(,"MM/dd/yyyy") and the ${ReportDate} parameter is stripped out. I have checked the setting for Remove Empty Content and it is set to false. The client program that uses this web service passes the macro correctly in its entirety.10 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.2KViews0likes1Comment