Category: Code Snippet

  • soapUI: Code snippet notes

    ,

    groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) inventorySummaryResponse = groovyUtils.getXmlHolder(“getInventorySummary returns quantity 24#Response”); inventorySummaryResponse.declareNamespace(“soapEnv”, “http://schemas.xmlsoap.org/soap/envelope/” ); inventorySummaryResponse.declareNamespace(“ns2”, “http://service.unifiedinventory.inventory.ticketmaster.com/” ) inventorySummaryList = inventorySummaryResponse.getDomNodes(“//inventorySummary”); int counter; for (inventorySummary in inventorySummaryList) { quantities = inventorySummary.getChildNodes(); for (quantity in quantities){ if (quantity.getNodeName() == “quantity”) { for (place in quantity.getChildNodes() ) { if (place.getNodeName() == “place”) { if (place.getAttributes().getNamedItem(“availabilityStatusId”).getNodeValue() == “1”)…

  • Get a list of TestSuite names in soapUI via Groovy Script

    ,

    Add a Groovy Script test step and add the following: def project = context.testCase.testSuite.project; for (testSuite in project.testSuiteList) { log.info testSuite.name; }

  • soapUI: Dynamic timestamp

    , ,

    Add a property, e.g. currentTimestamp, then add the following: ${=new java.text.SimpleDateFormat(“yyyy-MM-dd’T’HH:mm:ss”).format(new Date())} It will create the date in this format: 2013-03-12T11:03:05 Happy SOAP’ing!

  • soapUI: One liner random number Groovy script

    ,

    Add the following in a Groovy Script step; for example, called “Random”: context.randomValue = String.valueOf((int)(Math.random()*9999999)) Use in request like so: ${Random#result}

  • soapUI: Run each test suite with testrunner.sh

    ,

    I was encountering “permspace” “Out.Of.Memory” errors, and I believe it’s because of a memory leak with the UI/Java. In any case, this worked for me: 1. Create a text file with the test suite names — will automate this soon by “capturing” the names from the XML project file. 2. Loop through it via the…

  • SVN Fix: Could not use external editor to fetch log message

    In case you encounter the following error using SVN — on my Mac, for me: svn: E205007: Could not use external editor to fetch log message; consider setting the $SVN_EDITOR environment variable or using the –message (-m) or –file (-F) optionssvn: E205007: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no…