w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
script library using Groovy - SOAPUI
You need create a JAR with your code and put it to bin/ext in your soapui directory (for example C:/Program%20Files/SmartBear/soapUI-Pro-3.0-beta-2/bin/ext/sqljdbc.jar ) so it will be added to soapui classpath

Categories : Groovy

soapUI - embbed XML in a request using groovy
A Groovy script test step which goes with your test suite as below: def grUtils = new com.eviware.soapui.support.GroovyUtils(context) def holder = grUtils.getXmlHolder( context.expand('${TestStep#Response#//node}')) println holder.getXml() //where TestStep = Your test Step where you get the response //node = The xml node you want to pick. In your case it is "dataList"

Categories : Xml

Dynamically setting input in SOAPUI requests with Groovy
Ok, solved it. You have to create a context for the testStep where you currently are, like this: import com.eviware.soapui.impl.wsdl.teststeps.* def project = context.testCase.testSuite.project def testSuite = project.getTestSuiteAt(5) def testCase = testSuite.getTestCaseAt(1) def testStep = testCase.getTestStepAt(1) // this will get the current teststep name def teststepname = testStep.getName().toString() //create a context for the teststep where we are def testStepContext = new com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext(testStep); //create a util on the testStepContext def groovyUtils = new com.eviware.soapui.support.GroovyUtils( testStepContext ) def inputHolder = teststepname + "#Request" def holderRawReq = groovyUtils.getXmlHolder(inputHolder) holderRawReq["/

Categories : Groovy

Soapui Groovy - No Signature of Method error on ProWsdlTestSuitePanelBuilder.buildDesktopPanel
Okay, so this falls under the newbie catagory. I wasn't paying attention to the fact that buildDesktopPanel was static. However, I managed to work around that and create the final product: // Create a UISupport container for all the panels we'll be showing def UIDesktop = new com.eviware.soapui.support.UISupport(); // Basic environment information def properties = new com.eviware.soapui.support.types.StringToObjectMap(); def currentProject = testRunner.getTestCase().testSuite.getProject(); def workspace = currentProject.getWorkspace(); // Get the various Projects we'll be using def OtherProject = workspace.getProjectByName('Other Project'); // Get the various TestSuites we'll be running def OtherTestSuite = OtherProject.getTestSuiteByName('Other Test Suite'); // Generate the Pane

Categories : Groovy

How to add child elements dynamically to SOAP request in SOAPUI using groovy script
Check out Scott Davis's post on creating XML with groovy I used MarkupBuilder to create an XML that looks exactly like what you want. def sw = new StringWriter() def xml = new groovy.xml.MarkupBuilder(sw) xml."basket:createBasketRequest"(){ "basket:item"(){ "basket.itemId"("111") "basket:itemCode"("ABC") } "basket:item"(){ "basket.itemId"("222") "basket:itemCode"("DEF") } "basket:itemsTotal"("500.00") } log.info sw Output i got: <basket:createBasketRequest> <basket:item> <basket.itemId>111</basket.itemId> <basket:itemCode>ABC</basket:itemCode> </basket:item> <basket:item> <basket.itemId>222</basket.itemId> <basket:itemCode>DEF</basket:

Categories : Groovy

How to stop infinite loop while executing Test Case in soapUI using Groovy Script
Lets say you want to run "Test Case 1" which has multiple steps (13 in your case). It also has a groovy step "G1" (test index 1) from where you are initiating the test execution. What happens when you run the test Case from G1 is the test case executes its test steps 1 by one and as soon as it reaches G1 it start executing again because that's what you are doing in that step. Hence you end up with an infinite loop. What you should do is keep the step that starts the execution out of the test case that has to be executed. Traditionally such a script is called a driver script and is either a separate test case or outside the application itself. To solve your problem you could do one of the following. 1. Disable the step G1 from where you are starting the execution so that when the test ru

Categories : Groovy

Remove WSDL from soapui project without removing test suite [To reduce size of SoapUI project file]
Now this was fun.. There are two ways through which you can reduce the size of the soapUI project XML. 1) Uncheck the caches and associated WSDLs locally for offline access and improved performance option under preferences>WSDL Settings like in the below image. This setting has no impact on existing projects just on projects that will be created after this option is checked/unchecked. Having this option unchecked can significantly reduce the size of the soapUI project. See the image below, both of these projects were created using the same WSDL and the size is reduced by half. I had another instance where the size reduce from ~400kb to 100 kb after this option was unchecked. 2) Edit the soapUI project xml, this is useful when the project exists and test suites have already been cr

Categories : Web Services

How to get a value from a JSON (string) in Groovy
Use JsonSlurper. import groovy.json.JsonSlurper def str = '{"id":"12345678","name":"Sharon","email":"sharonu0040example.com"}' def slurper = new JsonSlurper().parseText(str) assert slurper.email == 'sharon@example.com' assert slurper.name == 'Sharon'

Categories : Groovy

Jenkins groovy build step trigger another job in groovy script removes original job's parameters
After trying many options, I decided to load the default parameters for the job I'm about to trigger and add them to the parameter array I'm preparing as in the example below. I used the example from here to get my job's initial default configuration. I still has to add some logic to choices parameters and null values, but I'm happy with the current result. I hope this helps.

Categories : Groovy

Groovy-Grails Tool Suite (GGTS) content assist not recognizing basic groovy
Make sure that you're in the Grails perspective; that can impact some of the Groovy/Grails features and how Eclipse (even GGTS) leverages them. You'll find the perspective button in the upper right. If you're in Java or Debug, odd things like this may occur. Also, how are you creating and opening your Groovy files? Do you use the context menus or the Grails command prompt tool to issue orders like "create-controller"? If you're creating the files in some other way, try using those methods to generate them, and see if you get the same results.

Categories : Eclipse

IntelliJ + groovy DSL: How to exclude files from being compiled by groovy plugin?
Try removing the groovy file suffix from the compiler's resources list: Settings -> Compiler

Categories : Java

Using a groovy class in other jenkins groovy scripts
What I would do is following, instead of trying to make it all work manually, I would create maven project or gradle one and organize your groovy files within resulted project. When configure maven or gradle to run it. Once maven or gradle runs it without any issues, you can give it to jenkins. Jenkins takes maven projects for sure and for gradle you will have to check, however one thing for sure, is maven runs you groovy project locally it will run without any issues under Jenkins as well. Please try, let me know.

Categories : Jenkins

What is the difference between BuildConfig.groovy and Config.groovy?
From Grails doc here The first, BuildConfig.groovy, is for settings that are used when running Grails commands, such as compile, doc, etc. The second file, Config.groovy, is for settings that are used when your application is running. This means that Config.groovy is packaged with your application, but BuildConfig.groovy is not.

Categories : Grails

Major improvements from Groovy 1.8 to 2.0 (Groovy 1.8 vs 2.0)
InfoQ has very good and detailed article about improvements in Groovy 2.0: http://www.infoq.com/articles/new-groovy-20 official announce http://glaforge.appspot.com/article/groovy-2-0-released

Categories : Groovy

groovy ObjectGraphBuilder build complex object from Java objects not groovy objects
It should work with Java classes as good as Groovy classes. Groovy class is ultimately compiled to byte code as Java. So there should not be any problem. Refer example in groovy docs for ObjectGraphBuilder to see how it works with POGO. Replace them with POJOs in a project, you would see the same behavior.

Categories : Groovy

Parsing XML from a stream, C# / SoapUI
If the node is null, you will need to check that before you assign the variable. Try this: xmlPayload = xmlSoapRequest.SelectSingleNode("/payload/@value") != null ? xmlSoapRequest.SelectSingleNode("/payload/@value").Value : "value not available"; However, I believe a better way would be using InnerText xmlPayload = xmlSoapRequest.GetElementByTagName("payload") != null ? xmlSoapRequest.GetElementByTagName("payload").InnerText : "value not available"; The format is like this: var variable = condition ? A : B; It's basically saying that if condition is true, variable equals A, otherwise variable equals B.

Categories : C#

soapUI with Maven from IntelliJ
According plugin doc you can override the log4j config for soapUI : You can also override the default log configuration by providing a 'soapui-log4j.xml' file in the project base directory. This works both with smartbear plugins (open source and pro) and maven-soapui-extension-plugin. So be sure to use the correct filename, location and format (xml... but it may also work with a 'soapui-log4j.properties' : I didn't try)

Categories : Maven

XQuery Expression in Soapui
Use matches() for regex: where matches($x/ns3:BuildingNumber, '^JJJ.*') Also, be careful with text() - usually you want string(). This article offers a very good explanation.

Categories : Regex

Getting an error connecting web service using SOAPUI
Try disabling the proxy in SOAP-UI, which indicated in the attached screen shot. Or Give a valid proxy connection under Proxy settings in SOAP UI Global preference. By disabling the proxy preference SOAP UI may work in offline. Hope it might solve your issue. Thanks, Madhan

Categories : Web Services

Http call parameters SoapUI
Use groovy script test step to read data from txt file and store the data in TestCase property . Something like this would work: String fileContents = new File('/path/to/file').text; testRunner.testCase.setPropertyValue(property_name, fileContents); More information about groovy script steps here. You can access this property as ${#TestCase#property_name} in your requests. Then you can use template parameters for your request url - I've already answered about it here.

Categories : Http

Why I get higher TPS (and more stable) when using JMeter instead of SoapUI?
Are you using a single server for generating load? There is an option to increase socket timeout in soapUI preference, see if that helps. The only reason i can think of why the web server is not getting some of the request is that the port being used is getting bogged down. In addition to increasing the socket timeout, try to use different load generator or better yet use loadUI. Also, check soapUI's memory mgmt page http://www.soapui.org/Load-Testing/memory-management.html Speaking from personal experience, i have found jmeter to be more reliable for performance testing WS than soapUI.

Categories : Web Services

How can I get SoapUI request to work on a webserver
This question already have a solutions at stackoverflow. Look at this answers: http://stackoverflow.com/a/10505172/2324993 http://stackoverflow.com/a/1656763/2324993

Categories : PHP

WSDualHttpBinding - Java or SoapUI Client
I'm not sure dual binding is interoperable with clients other than WCF. I read once that Metro (WSIT) stack for Java supports it. But the safest will be to use a WCF client. The reason is that the dual binding assumes the client should get messages from the server in a callback endpoint. This is not so standard, also in terms of defining this properly in a WSDL file. You might be able to get away with it by setting up a dedicated server on your client side waiting for the WCF response. But the wiring will be time consuming. If you own the server you might want to make it more explicit that the client is supposed to have a server endpoint to get callbacks to or you could use some WCF router as an intermediate. UPDATE: check this link to read why WSDualHttpBinding is not interoperable wit

Categories : Java

SoapUI error with Yii generated WSDL
Can you provide more detailed example of your generated wsdl? You may get this error, for example, if "foo" element lies inside xs:all tag - it specifies that each child element can occur zero or one time so maxOccurs value must be 1. This problem is solved by putting element inside xs:sequence tag instead of xs:all that enables "unbounded" value for maxOccurs.

Categories : PHP

How can you pass a parameter into you fitnesse test with soapui?
Is the random number from step 1 in the response? Is yes then you can use xpath to get the random value and use that value in step 3. Would you be able to provide the response from step 1?

Categories : Selenium

SoapUI Maven plugin has weird dependencies
Just came across this plugin: https://github.com/redfish4ktc/maven-soapui-extension-plugin which notes: "starting from soapui 3.6.1, almost all SmartBear plugin versions have missing dependencies. This is fixed in maven-soapui-extension-plugin" It also appears to address some Groovy dependencies which others have noted as an issue with the plugin.

Categories : Maven

Recreate a working SOAP request from SoapUI to PHP
Okay! I Finally figured this out. It is ugly but it works. try { $args = array( 'sessionid'=>$session, 'searchcriteria'=> new SoapVar('<searchCriteria><ns1:AttributeValue> <ns1:attribute>dateupdated</ns1:attribute> <ns1:value xsi:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">01/01/2013</ns1:value> </ns1:AttributeValue> <ns1:AttributeValue> <ns1:attribute>dateupdatedcompare</ns1:attribute> <ns1:value

Categories : PHP

How to create repeating fields in REST with soapUI?
Trying to find answer to same question I found this link from soapUI support forum which gives the answer. There is property "Multi-value delimiter" in Request Properties in soapUI (bottom left corner). You need to specify this delimiter (for example "|") and then you can provide multiple values in soapUI using the delimiter which you specified (example: one|two|three, will send array of three elements: one, two, three).

Categories : Rest

Invoke wso2 admin services SOAPUI
You could try accessing the server using a java client. There is an example here. You could try this example and dump out the SOAP message to see the difference against what you are seeing in SOAPUI. I'm wondering if the example axis client's setManageSession(true) does some magic on the session: public static void main(String[] args) throws RemoteException, AuthenticationAdminAuthenticationExceptionException { System.setProperty("javax.net.ssl.trustStore", SampleConstants.CLIENT_TRUST_STORE_PATH); System.setProperty("javax.net.ssl.trustStorePassword", SampleConstants.KEY_STORE_PASSWORD); System.setProperty("javax.net.ssl.trustStoreType", SampleConstants.KEY_STORE_TYPE); Authentica

Categories : Wso2

Running SoapUI test cases using testRunner
If you want to use soap ui in external code, try to directly create new test runner with specific project file: SoapUITestCaseRunner runner = new SoapUITestCaseRunner(); runner.setProjectFile( "src/dist/sample-soapui-project.xml" ); runner.run(); Or if you want to define test execution more precisely, you can use something like this: WsdlProject project = new WsdlProject( "src/dist/sample-soapui-project.xml" ); TestSuite testSuite = project.getTestSuiteByName( "Test Suite" ); TestCase testCase = testSuite.getTestCaseByName( "Test Conversions" ); // create empty properties and run synchronously TestRunner runner = testCase.run( new PropertiesMap(), false ); PS: don't forget to import soap ui classes, that you use in your code and put them to classpath. PPS: If you need just run

Categories : Groovy

SoapUI Escaped Quotes Cause Assertion Failures
What kind of assertion are you using? Have you tried a script assertion or removing the quotes from your expected assertion value? Can you please share the xml or the piece of xml which has the string in quotes? Try this as a script assertion def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) def holder = groovyUtils.getXmlHolder(messageExchange.responseContentAsXml) String val = holder.getNodeValue('xPath to the value you want to extract') assert 'The expected value in quotes' == val, "Appropriate message if the assertion fails" The OP needs to be able to pick the expected value from a csv and compare it with what was received in the response. As you are using the pro version of soapUI use the datasource to fetch the values from your csv file. Lets consider tha

Categories : Xml

Receiving SOAP messages from a web-service with SoapUI
If I'm following your question right, you want the C# side to be an asynchronous web service? Here's a general tutorial: http://msdn.microsoft.com/en-us/library/ms731177.aspx If you are manually implementing the web service, you could kick off your XML parsing in its own thread: http://msdn.microsoft.com/en-us/library/aa645740(v=vs.71).aspx Although you would have to think about how you wanted to handle errors.

Categories : Xml

Test Automation: TeamCity with Selenium and SOAPUI and Calabash
You can setup different builds for each step since you can trigger builds via simple GET requests triggered by a script. TeamCity Accessing Server by HTTP We run a similar setup. Basically we have one build kick off the Selenium/SoapUI scripts. That build doesn't wait for the job to finish, it just kicks it off. Then in our Selenium/SoapUI tests as the last step we hit the URL for the next build that picks up reports etc.

Categories : Selenium

Calling SOAP Web-Services with PHP cURL (moving from SOAPUI)
You can try this. This is what I used when I wound up using cURL in .php for a SOAP Web-Service. $envelope = '<soap:Envelope> .... </soap:Envelope>'; $soap_do = curl_init(); curl_setopt($soap_do, CURLOPT_URL, "https://ccws-services.ecollege.com/EnterpriseServices/v2.1/EnterpriseCourse.svc" ); curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($soap_do, CURLOPT_TIMEOUT, 10); curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true ); curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($soap_do, CURLOPT_POST, true ); curl_setopt($soap_do, CURLOPT_POSTFIELDS, $envelope); curl_setopt($soap_do, CURLOPT_VERBOSE, TRUE); curl_setopt($soap_do, CURLOPT_HTTPHEADER, ar

Categories : PHP

SOAP response containing SERIALIZED DICTIONARY is not valid in SoapUI
At least part of the problem is due to the dictionary serialization code: the de-serialization expects something like this: <dictionary> <item> <key>the key</key> <value>the value</value> </item> ... </dictionary> but the serialization code generates: <dictionary> <the key>the value</the key> . . . </dictionary> The serialization should be something like this: void IXmlSerializable.WriteXml(XmlWriter writer) { foreach (object key in dictionary.Keys) { object value = dictionary[key]; writer.WriteStartElement("item"); writer.WriteElementString("key", key.ToString()); writer.WriteElementString("value", value.ToString()); writer.WriteEndElement();

Categories : Web Services

Can web service testing done using SOAPUI tool be done in Java completely?
You can create client and pass in HTTP Request test request populated with needed parameter for testing purpose, below mention question has some useful insights. Java Web service testing

Categories : Java

SoapUI throws Object reference not set: how to find reason
You can not test this webservice from soap UI like this. Reason is, At your server, in your webservice implementation. It is expecting object type while you are providing string or integer tpe. Thats why it is giving you this error. Wrap around these inputs in Objects then pass this request. Thanks, ambuj

Categories : Java

Is it possible to call web service method with less parameters through SoapUI tool
Using the XML view of a Test Request test step in soapUI you can freely edit what shall be sent. Example: <soap...> <MyUpdateRequest> <name>true</name> </MyUpdateRequest> </soap...>

Categories : Web Services

How to send a C# SOAP response to SoapUI before closing the web service?
I think the best you can do is log the time right before you return a value. The only way I've seen for services to continue processing after they send a response is to create another thread for it, which wouldn't help in this case.

Categories : C#

How do I create dynamic user credentials and then use them in later REST requests in soapui pro?
Random values generation and setting properties should be done in groovy script test step. In groovy script write smth like this: import java.util.Random //generating random values Random rand = new Random() String username = "testmail" + rand.nextInt(100000) + "@example.com" String password = "woof" + rand.nextInt(100000) //setting test case properties testRunner.testCase.setPropertyValue("username", username); testRunner.testCase.setPropertyValue("password", password); In test case you can access this properties as ${#testcase_name#property_name}. More information about properties here: http://www.soapui.org/Scripting-Properties/tips-a-tricks.html#1-accessing-properties-settings-and-names and about scripting here: http://www.soapui.org/Scripting-Properties/scripting-and-the-script

Categories : Json



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.