Github user ra0077 commented on a diff in the pull request: https://github.com/apache/jmeter/pull/223#discussion_r73667767 --- Diff: src/core/org/apache/jmeter/util/JSR223TestElement.java --- @@ -86,11 +88,16 @@ public JSR223TestElement() { } protected ScriptEngine getScriptEngine() throws ScriptException { - final String lang = getScriptLanguage(); + String lang = getScriptLanguage(); + + if (lang.isEmpty()) { + lang = defaultScriptLanguage; + log.warn("Script language has not been chosen on the UI, the script will be interpreted as a groovy script"); --- End diff -- My first idea was to put Groovy as default script language in the GUI but this solution have a lot of impact (like all the modifications of a default value with compatibility) The best solution will be to add a "Check script" button to verify the script and advice users of their mistakes and best practices to apply to their script (if you know how to implement it, please share it) For the moment if the user forget to define a script language, he needs to check the errors in log (by GUI or in the file) and I think it's not user friendly Call each time getScriptEngine method is already not a good solution for performance (need to check if the JIT don't inline it) because I am not sure that modify dynamically the script language during the execution of the script is very useful feature used by someone (but if you have a use case, please share it) 1) I am OK with you, I can modify the warn message 2) For the moment script language can be modified at each iteration of the test. It means that sometime the script language could be good and sometimes no. If the message is printed only once, it will be incomplete and false. If we don't modify the behavior of JMeter (allow to dynamically change the script language), the better solution I have is to print a better message. If you have a better solution, please let me know.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---