Forum Discussion

mohantysuchi's avatar
mohantysuchi
Occasional Contributor
6 years ago

getting the groovy.lang.MissingMethodException: No signature of method in groovy script

Hi , 

 

I am getting below error while running my groovy script in soap ui 5.3.0

 

error:

groovy.lang.MissingMethodException: No signature of method: com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.setPropertyValue() is applicable for argument types: (java.lang.String, java.lang.Integer) values: [Quantity, 2] Possible solutions: setPropertyValue(java.lang.String, java.lang.String), getPropertyValue(java.lang.String) error at line: 46

 

Groovy script:

//Script finds defect id, workorder id, org id required for "Add Item" test case for a normal service sheet defect.

import groovy.sql.*
import com.eviware.soapui.support.GroovyUtils;
def groovyUtils = new GroovyUtils();
import groovy.json.JsonSlurper
import groovy.util.XmlSlurper

def connstr = context.expand('${#Project#groovy_connstr}')
def dbuser = context.expand('${#Project#db_user}')
def dbpassword = context.expand('${#Project#db_password}')
def oracledriver = context.expand('${#Project#OracleDriver}')
def sql = Sql.newInstance(connstr, dbuser, dbpassword, oracledriver)


log.info "DB connection ready"

def dbValues3 = sql.rows("select g.service_material_id, g.QUANTITY,g.reverse_quantity, p.picked_quantity, p.returned_quantity, p.shopping_cart_detail_id,p.shopping_cart_header_id, g.service_workorder_id,g.service_organization_id from gets_pc.gets_pc_shopping_cart_details p, gets_pc.gets_pc_shopping_cart_header h,gets_lms.gets_lms_material_usage g where p.shopping_cart_header_id=h.shopping_cart_header_id and p.shopping_cart_detail_id= g.shopping_cart_detail_id and p.shopping_cart_status='Picked' and p.picked_quantity<p.requested_quantity and p.picked_quantity>=1 and p.returned_quantity=0 and rownum=1") //is only one row?

assert dbValues3.size == 1


//printing the DB column values and storing the required DB column values as testcase property

log.info dbValues3[0].picked_quantity.toString()
log.info dbValues3[0].shopping_cart_detail_id.toString()
log.info dbValues3[0].service_material_id.toString()
log.info dbValues3[0].service_workorder_id.toString()
log.info dbValues3[0].service_organization_id.toString()
log.info dbValues3[0].QUANTITY.toString()
log.info dbValues3[0].reverse_quantity.toString()

def int quantity=dbValues3[0].picked_quantity.toInteger()+1
log.info quantity

def testCase = context.testCase

testCase.setPropertyValue("PickedQuantity",dbValues3[0].picked_quantity.toString())
testCase.setPropertyValue("ServiceMaterialID", dbValues3[0].service_material_id.toString())
testCase.setPropertyValue("ShoppingCartDetailID", dbValues3[0].shopping_cart_detail_id.toString())
testCase.setPropertyValue("ServiceWorkorderID", dbValues3[0].service_workorder_id.toString())
testCase.setPropertyValue("ServiceOrganizationID", dbValues3[0].service_organization_id.toString())
testCase.setPropertyValue("Qty", dbValues3[0].QUANTITY.toString())
testCase.setPropertyValue("reverseQty", dbValues3[0].reverse_quantity.toString())
testCase.setPropertyValue("Quantity", quantity)


def dbValues2 = sql.rows("select user_id from fnd_user where employee_id ='212576711' ")
log.info dbValues2[0].user_id.toString()
testCase.setPropertyValue("UserID", dbValues2[0].user_id.toString())


sql.close()

 

Could some one please help quickly

No RepliesBe the first to reply