I just upgraded to 6.0.5 and the global variable I have set up to define a directory structure for screenshots (suggested in this forum), is suddenly no longer working. Any ideas why?
Error details:
2019-03-07 16:55:03.006 e[1;31mERRORe[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[31m❌ com.kms.katalon.core.exception.KatalonRuntimeException: Could not evaluate default value for variable: imgDir of profile: PX. Details: No such property: RunConfiguration for class: Script13e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain.getGlobalVariables(TestCaseMain.java:186)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain$getGlobalVariables$1.call(Unknown Source)e[0;39m
e[31m at internal.GlobalVariable.(GlobalVariable.groovy:148)e[0;39m
e[31m at Script2.run(Script2.groovy:1)e[0;39m
e[31m at com.kms.katalon.core.main.ScriptEngine.runScriptWithoutLogging(ScriptEngine.java:105)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseExecutor.lambda$0(TestCaseExecutor.java:383)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseExecutor.collectTestCaseVariables(TestCaseExecutor.java:370)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseExecutor.processScriptPreparationPhase(TestCaseExecutor.java:152)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:205)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)e[0;39m
e[31m at TempTestCase1551995699863.run(TempTestCase1551995699863.groovy:21)e[0;39m
e[31mCaused by: groovy.lang.MissingPropertyException: No such property: RunConfiguration for class: Script13e[0;39m
e[31m at Script13.run(Script13.groovy:1)e[0;39m
e[31m at com.kms.katalon.core.main.ScriptEngine.runScriptWithoutLogging(ScriptEngine.java:105)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain.getGlobalVariables(TestCaseMain.java:184)e[0;39m
e[31m … 12 more
imgDir is pointed to a Global Variable which is defined as:
imgDir RunConfiguration.getProjectDir() + ‘/Reports/Screenshots/PX/’
Script seems to be barfing on the global variable definition (this was working flawlessly until I upgraded, not sure what happened!).
Error again:
2019-03-07 17:45:19.453 e[1;31mERRORe[0;39m e[36mc.k.katalon.core.main.TestCaseExecutor -e[0;39m e[31m❌ com.kms.katalon.core.exception.KatalonRuntimeException: Could not evaluate default value for variable: imgDir of profile: PX. Details: No such property: RunConfiguration for class: Script13e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain.getGlobalVariables(TestCaseMain.java:186)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain$getGlobalVariables$1.call(Unknown Source)e[0;39m
e[31m at internal.GlobalVariable.(GlobalVariable.groovy:148)e[0;39m
e[31m at Script2.run(Script2.groovy:1)e[0;39m
e[31m at com.kms.katalon.core.main.ScriptEngine.runScriptWithoutLogging(ScriptEngine.java:105)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseExecutor.lambda$0(TestCaseExecutor.java:383)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseExecutor.collectTestCaseVariables(TestCaseExecutor.java:370)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseExecutor.processScriptPreparationPhase(TestCaseExecutor.java:152)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:205)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)e[0;39m
e[31m at TempTestCase1551998716280.run(TempTestCase1551998716280.groovy:21)e[0;39m
e[31mCaused by: groovy.lang.MissingPropertyException: No such property: RunConfiguration for class: Script13e[0;39m
e[31m at Script13.run(Script13.groovy:1)e[0;39m
e[31m at com.kms.katalon.core.main.ScriptEngine.runScriptWithoutLogging(ScriptEngine.java:105)e[0;39m
e[31m at com.kms.katalon.core.main.TestCaseMain.getGlobalVariables(TestCaseMain.java:184)e[0;39m
e[31m … 12 more
Using a GV is not your only option here. You could call a static somewhere early (test listener?) and set a global of your own which you import “everywhere”. IOW, create a proper var in your own keyword class and leave GVs out of the picture.
Interesting. Just re-downloaded 5.10.1 and the same piece of code works without issue. Strange! Well, like you said, there are other ways around it. Thanks for the help!