-
Hi, I am not sure how I can convert the above code snippet to jsrPreProcessor String script. I tried with the reference
Getting below error in Blazemeter logs as Authorization value is not setting with above code in Blazemeter 2023-06-22 10:43:48,941 ERROR o.a.j.m.JSR223PreProcessor: Problem in JSR223 script, JSR223 PreProcessor Please help me with migrating code from java lamda to run the same test in Blazemeter tool also. Thanks Please help @rabelenda |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
Something you may try is using the java lambda as is and include jmeter-java-dsl jar and a jar containing any classes you may need (for example the class containing the getAuthorizationHeader() method. I haven't tried this myself, but it should work even though would require proper packaging of custom logic (like getAuthorizationHeader). The usual way I handle such scenarios is just converting the logic to groovy and using groovy script. In general converting logic to groovy is pretty straightforward since groovy is compatible with java and a lot of java code is valid groovy code. But again, depends on what you have inside getAuthorizationHeader. If you use some jar dependency for instance, you would need to add it as asset to run in Blazmeter. Can you provide more details of getAuthorizationHeader logic? In the future would be nice to have automatic lambda execution support in BlazeMeter (or any other cloud provider). We haven't invested on this, but if more people are interested in such support we me reprioritize. |
Beta Was this translation helpful? Give feedback.
-
Hello, basically in the pom configured:
The code just defines the jars (test jar and dependencies) as assets to be uploaded to BlazeMeter test. The assets method is available since version 1.11. You can check here. Maybe you missed updating your IDE pom or something so it finds latest methods (in IntelliJ at least, every time you update the pom, you need to hit a little button that appears with an m and two curved arrows)? |
Beta Was this translation helpful? Give feedback.
We have released a new version which provides an alternative for running lambda code in BlazeMeter and a new user guide section with details.