emmanuelfloresOccasional ContributorJoined 8 years ago8 Posts1 LikeLikes received1 SolutionView All Badges
ContributionsMost RecentMost LikesSolutionsRe: Groovy: second enum class not picked up on compilation Well, I figured it out and I'm not sure why it works this way. In ReadyAPI I had to use the Enum class directly in a script for it to be loaded or recognized as a class. Groovy: second enum class not picked up on compilation Hello, I'm trying to set up a groovy script that lives in the groovy library, however I keep encountering a compilation error. The class below is called by another script to pull values from the arrays. The groovy class uses enums from other 2 other groovy classes to reference some data. All 3 classes are in the same script folder. The code looks like the following (note I've cut it down for brevity) package somePackage class SomeBins{ def log def SomeBins(log){ this.log = log } def firstBinColors = [ '3+':FirstBinColorEnum.FIVE, '2.5+':FirstBinColorEnum.FOUR] def secondBinColors= [ '3+':SecondBinColorEnum.EIGHT, '2.5 - 2.75':SecondBinColorEnum.SEVEN, '2.0 - 2.25':SecondBinColorEnum.SIX] // some functionality that works... def getFirstBinColor(bin){ return firstBinColors[bin].getValue() } def getSecondBinColor(bin){ return secondBinColors[bin].getValue() } } The enums are very similar,but in different files in the same folder, defined as: package somePackage public enum FirstBinColorEnum{ FIVE('74a9cf'), FOUR('a6bddb') private final String color; def FirstBinColorEnum(String color){ this.color = color } def getValue(){ return this.color } } and package somePackage public enum SecondBinColorEnum{ EIGHT('74a9cf'), SEVEN('74a9cf'), SIX('a6bddb') private final String color; def SecondBinColorEnum(String color){ this.color = color } def getValue(){ return this.color } } When I try running the script an error is always thrown for SecondBinColorEnum. If I take it out, it finds FirstBinColorEnum class. The following is the error it throws Thu Apr 04 17:46:21 MDT 2019: ERROR: An error occurred in the script of the Groovy Script test step [Groovy Script]: Thu Apr 04 17:46:21 MDT 2019: ERROR: groovy.lang.MissingPropertyException: No such property: SecondBinColorEnum for class: somePackage.SomeBins groovy.lang.MissingPropertyException: No such property: SecondBinColorEnum for class: somePackage.SomeBins at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:53) at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:87) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:307) at somePackage.SomeBins.<init>(SomeBins.groovy) I am at a complete loss. Initially I had added the firstBinEnum class and worked great. But adding the second one, exactly the same way doesn't seem to work. Any help from the groovy script gurus would be greatly appreciated. SolvedRe: parallel execution issues when framework has dependency of library testcases on other testsuite I have a set up similar to OP and I've run into similar issues except in my case, all of the LibTestSuite are just scripts calling other Test Suite Test Cases. The flow is like the following TestSuite A runs TestCase A TestCase A uses a Script to call a script in LibTestSuite Scipt in LibTestSuite calls another TestSuite to make calls for uploading a file If multiple test cases in TestSuite A are doing the same, it'll run into errors if run in parallel I think because we're calling the other test suites using the scripts, it causes some wierd dependency and the files can't be uploaded. We may need to try using the 'Call Test Case' instead and see if that helps but I'm not sure given how we set it up. I know this doesn't help your issue, but it's very similar and I'm curious of how to best handle that. Re: Unable to start Groovy debugging error keeps showing Hello Nastya, Thanks for the response. Is the error thrown regardless if one has turned debugging on? I don't recall it being turned on however it is entirely possible. I'll find those files, move them over and see how that works out. Thank you again. Unable to start Groovy debugging error keeps showing Every time I either load my project through Ready API or launch my suites through the test runner an error about debugging is thrown, yet I do not have debugging turned on. Well, as far as I can tell anyway. It's possible there's a setting I've missed. Any help would be greatly appreciated. The following is the error 8:34:36,110 ERROR [errorlog] Unable to start Groovy debugging 18:34:36,110 ERROR [errorlog] java.lang.ClassNotFoundException: com.sun.jdi.request.EventRequest java.lang.ClassNotFoundException: com.sun.jdi.request.EventRequest at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.eviware.soapui.tools.DebugSupport.<clinit>(DebugSupport.java:19) at com.eviware.soapui.impl.wsdl.teststeps.registry.GroovyScriptStepFactory.buildTestStep(GroovyScriptStepFactory.java:38) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.createTestStepFromConfig(WsdlTestCase.java:390) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.<init>(WsdlTestCase.java:162) at com.eviware.soapui.impl.wsdl.WsdlTestCasePro.<init>(WsdlTestCasePro.java:64) at com.eviware.soapui.impl.wsdl.WsdlTestSuitePro.buildTestCase(WsdlTestSuitePro.java:81) at com.eviware.soapui.impl.wsdl.WsdlTestSuitePro.buildTestCase(WsdlTestSuitePro.java:1) at com.eviware.soapui.impl.wsdl.WsdlTestSuite.<init>(WsdlTestSuite.java:115) at com.eviware.soapui.impl.wsdl.WsdlTestSuitePro.<init>(WsdlTestSuitePro.java:44) at com.eviware.soapui.impl.wsdl.WsdlProjectPro.buildTestSuite(WsdlProjectPro.java:1127) at com.eviware.soapui.impl.wsdl.WsdlProjectPro.loadProject(WsdlProjectPro.java:410) at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:275) at com.eviware.soapui.impl.wsdl.WsdlProjectPro.<init>(WsdlProjectPro.java:192) at com.eviware.soapui.impl.wsdl.WsdlProjectProFactory.createNew(WsdlProjectProFactory.java:110) at com.eviware.soapui.impl.wsdl.WsdlProjectProFactory.createNew(WsdlProjectProFactory.java:1) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.getWsdlProject(AbstractSoapUIRunner.java:379) at com.smartbear.ready.cmd.runner.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:356) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.runRunner(SoapUIProTestCaseRunner.java:97) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:258) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:161) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.init(SoapUIProTestCaseRunner.java:81) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.main(SoapUIProTestCaseRunner.java:77) java.lang.ClassNotFoundException: com.sun.jdi.request.EventRequest at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.eviware.soapui.tools.DebugSupport.<clinit>(DebugSupport.java:19) at com.eviware.soapui.impl.wsdl.teststeps.registry.GroovyScriptStepFactory.buildTestStep(GroovyScriptStepFactory.java:38) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.createTestStepFromConfig(WsdlTestCase.java:390) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.<init>(WsdlTestCase.java:162) at com.eviware.soapui.impl.wsdl.WsdlTestCasePro.<init>(WsdlTestCasePro.java:64) at com.eviware.soapui.impl.wsdl.WsdlTestSuitePro.buildTestCase(WsdlTestSuitePro.java:81) at com.eviware.soapui.impl.wsdl.WsdlTestSuitePro.buildTestCase(WsdlTestSuitePro.java:1) at com.eviware.soapui.impl.wsdl.WsdlTestSuite.<init>(WsdlTestSuite.java:115) at com.eviware.soapui.impl.wsdl.WsdlTestSuitePro.<init>(WsdlTestSuitePro.java:44) at com.eviware.soapui.impl.wsdl.WsdlProjectPro.buildTestSuite(WsdlProjectPro.java:1127) at com.eviware.soapui.impl.wsdl.WsdlProjectPro.loadProject(WsdlProjectPro.java:410) at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:275) at com.eviware.soapui.impl.wsdl.WsdlProjectPro.<init>(WsdlProjectPro.java:192) at com.eviware.soapui.impl.wsdl.WsdlProjectProFactory.createNew(WsdlProjectProFactory.java:110) at com.eviware.soapui.impl.wsdl.WsdlProjectProFactory.createNew(WsdlProjectProFactory.java:1) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.getWsdlProject(AbstractSoapUIRunner.java:379) at com.smartbear.ready.cmd.runner.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:356) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.runRunner(SoapUIProTestCaseRunner.java:97) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:258) at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:161) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.init(SoapUIProTestCaseRunner.java:81) at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.main(SoapUIProTestCaseRunner.java:77) Re: Loading or referencing environment properties Makes total sense and works as expected. Thank you for taking the time to help. Re: Loading or referencing environment properties I didn't realize there were global properties as well, however I'm not sure it'll work out for Environments settings. If we want to switch from envA to envB, we need to reference the credentials for envB. This does lead me to wonder if not checking in the settings.xml file for a Project would have the same impact. It seems like that's where the environment settings are saved. Loading or referencing environment properties Hello, I'm new to Ready API and SOAPUI NG in general. We're still trying to figure out best practices for various thing, in particular VCS. Our tests require a username password, however, we don't want to check in those values into our repository. One possible solution we were thinking about is having a properties file that never gets checked in, but lives in a directory SOAPUI can reference and load on application start up. Is this something SOAPUI can do? If not what are the other alternatives? What are some of the best practices on handling credentials, e.g., username, password, keys, in test cases and repository? Appreciate any help thrown my way. Solved