Re: TestRunListener.beforeStep eventHandler is not triggering TestStep execution
Not at pc. Open groovy script and look the editor's right corner of title bar. You would notice context, log, test runner etc., Similarly you can notice wherever one can script such as the events, teardown, setup script for test case, suite, project etc.,
So one can only use those variables in that script. Other than those will lead to error. That's the reason if some script works in test step, but not in the event in your case.
Here are couple of reasons - there is no testRunner available in Events listener script - the groovy script is present in test case, where there is step with the provided name. However, in the listener, they don't aware of those data. - your case is not valid for events
If you explain the details of your case, what you are trying to achieve and the context then probably that would be helpful.