Forum Discussion

mohantysuchi's avatar
mohantysuchi
Occasional Contributor
7 years ago

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

Hi,

 

I am getting below error while running groovy script test step. the error line in highlighted and bold

 

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: 44

 

script:

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()

No RepliesBe the first to reply