Thanks but I am already using this import statement
When I am executing the script, I am getting below error:
Caused by: com.kms.katalon.core.exception.StepFailedException: Unable to send request (Root cause: java.lang.IllegalArgumentException: URI is not absolute
Same script was working fine earlier but not working now
// Send the first request to get the attachment URL.
def response = WS.sendRequest(findTestObject(‘IRN’),
[(‘irn’): irn, (‘breederReference’): breederReference, (‘token’): token])
// Verify the response status code.
WS.verifyResponseStatusCode(response, 200)
// Get the attachment URL from the response.
attachmentUrl = WS.getElementPropertyValue(response, ‘apiResponseData.attachmentUrl’, FailureHandling.STOP_ON_FAILURE)
// Update the global variable with the attachment URL.
GlobalVariable.attachmentUrl = attachmentUrl
// Send the second request to send the attachment.
def responsePut = WS.sendRequest(findTestObject(‘SendAttachment’), [(‘attachmentUrl’): attachmentUrl])
// Verify the response status code for the second request.
WS.verifyResponseStatusCode(responsePut, 200)
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
file:/C:/Users/hsaxena/Desktop/Updated%20Test%20Pack/automation-test/Scripts/API%20Test%20Cases/CreateIRN%20API/Script1672121117054.groovy: 35: Invalid variable name. Must start with a letter but was: ‘IRN’
. At [35:46] @ line 35, column 46.
WS.sendRequest(findTestObject(‘IRN’),
Getting same issue with lower case :
Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
file:/C:/Users/hsaxena/Desktop/Updated%20Test%20Pack/automation-test/Scripts/API%20Test%20Cases/CreateIRN%20API/Script1672121117054.groovy: 35: Invalid variable name. Must start with a letter but was: ‘irn’
. At [35:46] @ line 35, column 46.
WS.sendRequest(findTestObject(‘irn’),
I need unique value in irn so I am using below line:
GlobalVariable.irn = (‘XU_’ + CustomKeywords.‘commonFunctions.CommonMethods.dateGenerator’())