Contributions
Groovy script test step is taking so long time to execute
Hi , My groovy script test step is taking so much time for execution. I am using sql queries to fetch data from DB. script: def dbValues3= sql.rows("SELECT i.attribute6,m.SERVICE_MATERIAL_ID,w.service_workorder_id,w.workorder_number,m.shopping_cart_detail_id,m.SERVICE_ORGANIZATION_ID,m.QUANTITY from gets_lms.gets_lms_material_usage m,GETS_INTF.GETS_INTF_MTL_SYS_ITEMS_B i,gets_lms.GETS_LMS_SERVICE_WORKORDER w WHERE i.inventory_item_ID=m.INVENTORY_ITEM_ID AND item_type IN ('UX', 'LR', 'RR') AND m.SERVICE_WORKORDER_ID=w.SERVICE_WORKORDER_ID AND quantity_due IS NULL AND i.attribute6 IS NOT NULL AND m.service_organization_id=120 AND i.ORGANIZATION_ID=103 and m.shopping_cart_detail_id is not null and m.quantity>1 and w.WORKORDER_STATUS_CODE NOT IN ('700','900')AND rownum=1") assert dbValues3.size == 1 //printing the DB column values and storing the required DB column values as testcase property log.info dbValues3[0].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].workorder_number.toString() if i use above sql query in DB tool i can get result set but in this script its taking much time to get values from DB. Can some one help with this?6 years agoPlace ReadyAPI QuestionsReadyAPI Questions941Views0likes1Commentgetting 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()913Views0likes0Commentsgetting 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: 4 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()630Views0likes0Commentsgetting 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 quickly1.7KViews0likes0Commentsneed help in using xl sheet for data parametrization in groovy scripting
Hi, I am getting the below error while executing groovy script code in soap ui. error:java.io.FileNotFoundException: C:\Users+0364\Documents\GE_Confidential\test data_automation project\testdata_reverse material.ods (The system cannot find the path specified) error at line: 7 Code used to use Xl in groovy scripting: import jxl.* import jxl.write.* WritableWorkbook workbook = Workbook.createWorkbook(new File("C:\\Users\530364\\Documents\\GE_Confidential\\test data_automation project\\testdata_reverse material.ods")) WritableSheet sheet = workbook.createSheet("Worksheet 1", 0) log.info(sheet1.isHidden()) Label label = new Label(0, 2, "Test data in Column A, Row 3"); //column=0=A,row=0=1 sheet.addCell(label); Label label1 = new Label(2, 2, "Column C, Row 3"); sheet.addCell(label1); workbook.write() workbook.close() Workbook workbook1 = Workbook.getWorkbook(new File("C:\\Users\530364\\Documents\\GE_Confidential\\test data_automation project\\testdata_reverse material.ods")) Sheet sheet1 = workbook1.getSheet(0) Cell a1 = sheet1.getCell(1,1) // getCell(row,column) -- place some values in myfile.xls Cell b2 = sheet1.getCell(1,2) // then those values will be acessed using a1, b2 & c3 Cell. Cell c2 = sheet1.getCell(1,3) log.info a1.getContents() log.info b2.getContents() Thanks, Suchismita log.info c2.getContents() workbook1.close()7 years agoPlace ReadyAPI QuestionsReadyAPI Questions693Views0likes1Commentgetting unable to resolve class Workbook error
Hi , I am getting below error while running groovy script in soap ui 5.3.0. unable to resolve class Workbook @ line 13, column 10. Workbook workbook1 = Workbook.getWorkbook(new File("C:\\file path\\testdata_reverse material.ods")) using the groovy script i am trying to fetch data from external xl sheet saved in my local and basically trying to perform data parameterization through xlsheet. Thanks, Suchismita7 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.7KViews0likes1Commentgetting class not found exception for oracle jdbc driver in groovy script
I am using groovy scripting in soap ui 5.3.0 to connect oracle DB and getting the below error while running the script? java.lang.classNotFoundException:oracle.jdbc.driver.OracleDriver import groovy.sql.* com.eviware.soapui.support.GroovyUtils.registerJdbcDriver("net.sourceforge.jtds.jdbc.Driver") 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 I have placed ojdbc14 and ojdbc6-11.2.0.3 in soap ui/bin/ext folder. can anyone help me this?7 years agoPlace ReadyAPI QuestionsReadyAPI Questions3.4KViews0likes2Comments