Rao,
The script at https://github.com/nmrao/groovyScripts/blob/master/xml/ConnectionString.groovy is throwing an error. I made no changes to it and ran it as is.
The output is
Environment : test, Connection name : wba
Details followed:
Host : host01
Port : 1500
User : wbauser
Password: wbapassword
Sid : test
Exception thrown
groovy.lang.MissingPropertyException: No such property: connectionDetails for class: ConsoleScript0
at ConsoleScript0.run(ConsoleScript0:89)
I ran this from the Groovy console from ReadyAPI, I also changed all of the println lines to log.info and ran from groovy script in SoapUI NG and got the same error
I made a change from
def connStr = getConnectionString(connectionDetails)
to
def connStr = getConnectionString(connetionDetails)
Now when I run the script I see all of the connections being logged to the output but it still throws an error at the very end
Exception thrown
java.lang.NullPointerException: Cannot invoke method parent() on null object
at ConsoleScript2.getConnectionDetails(ConsoleScript2:96)
at ConsoleScript2$getConnectionDetails.callCurrent(Unknown Source)
at ConsoleScript2.run(ConsoleScript2:87)
This is all very promising though, I added a few lines to pull out some data
def showConnectionDetails(def connexionDetails, String environmentName, String connectionName){
log.info "Environment : ${environmentName}, Connection name : ${connectionName}"
hostName = "${connectionName}"+"host" //new line
testRunner.testCase.testSteps['InputValues'].setPropertyValue(hostName, "${connexionDetails.host}") //new line
And in my Properties step "InputValues" all of the hosts are being logged as I need. If it could just run without the error at the end I think it would be exactly what I want.
I apologize if I am being confusing to you. I am trying not to be and I very much appreciate your help and your time.