Contributions
Re: How can I get a property value from the Project in groovy?
Thank you those make even it easier. This leads to another question though, I started using the dbUserId = context.expand( '${#Project#dbUserId}' ); to pull the property value. How can I set a property value? I tried: context.setProperty( '${#TestCase#currdattim}', currentDateChar26() ); I don't get any errors, but it also doesn't set the property value.5.9KViews0likes0CommentsRe: How can I get a property value from the Project in groovy?
Thanks Robert, I've already gone over that page and I've been able to use the sample: // get request property def request = testRunner.testCase.getTestStepByName( "Request 1" ); def property = request.getProperty( "request" ); to retrieve properties at the testStep and testCase level but still can't figure out how to access the properties set at the project level. I recently tried moving the properties down to the testSuite level but still haven't been able to accees the properties. I've tried: def hTestSuite = testRunner.getTestSuiteByName("My TestSuite"); but I get the error: groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.panels.support.MockTestRunner.getTestSuiteByName() is applicable for argument types: (java.lang.String) values: {"My TestSuite"}5.9KViews0likes0CommentsHow can I get a property value from the Project in groovy?
I'm retrieving some information from a db, using groovy scripts in my test cases. Instead of hard coding the userid, password, etc. I decided to make them properties of the project. The problem is I can't seem to figure out how to retrieve properties from the project. I was able to get/set properties at the testcase level but can't figure out the correct syntax to retrieve the project level properties.7.3KViews0likes6CommentsRe: I need help retrieving data from SQL Server in groovy script
I added the closure and that fixed it, thanks. I did try soapUI Pro and sent a purchase request to my manager but in the mean time my trial period ended. I'm trying to replace my DataSource steps with groovy scripts to get the test scripts running again.878Views0likes0CommentsI need help retrieving data from SQL Server in groovy script
In my test case I'm making a request that creates a number of database records, I'm trying to add a groovy script step that will retrieve one of the db records. I've stripped my script down to a bare minimum to test the connection but I still get an error. I'm using sql server 2005 for the db. import groovy.sql.Sql def sql = Sql.newInstance("jdbc:sqlserver://99.999.999.99", "dbuserid", "dbpass", "com.microsoft.sqlserver.jdbc.SQLServerDriver") sql.eachRow("select first_name from myTable") I'm getting this error: groovy.lang.MissingMethodException: No signature of method: groovy.sql.Sql.eachRow() is applicable for argument types: (java.lang.String) values: {"select first_name from myTable"}1.9KViews0likes2Comments