-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to write gatling tests in Java #2168
Comments
@ptrthomas This would be an excellent improvement. |
I would be really happy to see the java/gatling integration in karate. My naive tries to create the needed "bridge" parts failed because of my (not existing) Scala knowledge. Is there someone with Scala knowledge how can show me the way? |
Hello, I can take a look at this one, if it's ok... Scala's concise syntax will not be easy to replace, but maybe we could try to define some kind of dsl instead? For example:
would be replaced by:
|
@f-delahaye yes that sounds good, go ahead |
I can't get karate-gatling to compile on develop (jdk17)... [INFO] compiling 2 Scala sources and 1 Java source to D:\dev\karate\karate-gatling\target\test-classes ... Can't figure out what the problem is, karate-core compiles and is imported as a dependency... Someone else have the same issue? |
Never mind. |
for those interested in trying this, 1.5.0.RC2 has been released |
posted on social media LinkedIn: https://www.linkedin.com/feed/update/urn:li:activity:7137691423725780992 |
1.5.0.RC3 is available, also the "karate-todo" example has been updated to use this approach: https://github.com/karatelabs/karate-todo/blob/d7d47ecd824904f51faaa826ef163ba92f32607a/src/test/java/app/perf/TodoSimulation.java |
hi @ptrthomas, I am trying to rewrite the scala simulation file into java one and it looks like it doesn't pick urls and pathes that I defined in karate-config.js. Would appreciate the help, thanks |
Also did I understand from the code correctly, that setting call names is not supported yet for Java DSL?
|
will let @f-delahaye answer. I was able to get the |
Hi, I will take a look asap. |
As a workaround for |
@borzykin Maybe what you're looking for is It is still available but you may need to change your code to:
If you're using it in a different way, could you please share an example? Anyway, I will raise a PR for a more fluent api, something like:
|
Good to hear you found a workaround! However, do you have any reason to believe this Unless it's something to do with what you said in your initial post
but then could you please give a bit more details? Many thanks |
@f-delahaye changing the code to your example fixed the issues with the name resolver, thanks a lot |
@f-delahaye @ptrthomas
and just hardcode If I add this line to the simple.feature:
It start to work fine again. I am not competent enough to say it is correct behaviour or not, just pointing out that used to work on 1.4.1 version without this hacks |
That makes sense. As far as I know, karate-config-perf.js is not read by default unless the vm arg Anyway, back to your initial problem, which probably has nothing to do with the karate-todo example or karate-config-perf.js ;) |
Hello @ptrthomas , is there an java example for this feature ? I tried many ways but still not work. I want to use java to write gatling test. |
1.5.0 released |
refer: https://gatling.io/docs/gatling/reference/current/whats_new/3.7/
avoiding the need for Scala would be a great improvement
The text was updated successfully, but these errors were encountered: