Forum Discussion

mohantysuchi's avatar
mohantysuchi
Occasional Contributor
7 years ago

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?

 

1 Reply

  • groovyguy's avatar
    groovyguy
    Community Hero

    Have you tried putting in some log statements to see exactly what part of the script is taking the longest? I am going to assume that it is the query part, and unfortunately that's something that may be hard to troubleshoot. Can you post the script in its entirety?