How to resolve class loader issue? I am getting GroovyCastException : Cannot cast object.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2021
02:19 PM
05-26-2021
02:19 PM
How to resolve class loader issue? I am getting GroovyCastException : Cannot cast object.
Error message: org.codehaus.groovy.runtime.typehandeling.GroovyCastException:Cannot cast object 'com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase@378b3ab0' with class 'com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase' to class 'java.io.File' error at line: 3
Labels:
- Labels:
-
Data-Driven Testing
-
Scripting
-
SOAP
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2021
06:51 PM
05-26-2021
06:51 PM
Hey @Anju7121,
The error response youve supplied provide hints at an issue (casting to a file), however without more detail forum users are going to struggle to help.
Can you please provide further details? Im guessing this error response is either generated from a groovy script step or a script assertion.
Can you please provide the code and describe what the code is supposed to be doing?
Any further broad details of your testcase and how the script fits into the testcase wouldnt hurt either.
Cheers
Rich
The error response youve supplied provide hints at an issue (casting to a file), however without more detail forum users are going to struggle to help.
Can you please provide further details? Im guessing this error response is either generated from a groovy script step or a script assertion.
Can you please provide the code and describe what the code is supposed to be doing?
Any further broad details of your testcase and how the script fits into the testcase wouldnt hurt either.
Cheers
Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2021
12:39 AM
05-27-2021
12:39 AM
This is a groovy script. I am trying to set property and execute the test case.
Code:
//FilePath to .csv file provided in the Test Suite Property
def inputPath = testRunner.testCase.testSuite.getPropertyValue("FilePath")
File file = new File (inputPath.toString()).eachLine{
testRunner.testCase.testSuite.setPropertyValue("inGUID",it.split(",")[0])
def tc = testRunner.testCase.testSuite.testCases["TestCase 1"]
def runner = tc.run(null,false)
}
Note: This code worked fine before my computer abruptly restarted. So all the changes were lost and I had to rewrite the same code again, since then I am getting this error.
Code is typed manually in the response, kindly ignore the typos. I hope the snippet will give an overview.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2021
03:16 AM
05-27-2021
03:16 AM
Can you please try removing "File file = "
Regards,
Rao.
Regards,
Rao.
