karatelabs / karate

Test Automation Made Simple
https://karatelabs.github.io/karate
MIT License
8.25k stars 1.94k forks source link

[karatelabs/karate] Karate framework : Multi threaded access requested by thread Thread[nioEventLoopGroup-2-1,10,main] but is not allowed for language(s) js thrown when I use handle for the websocket #2410

Closed sofianeAmarouche closed 1 year ago

sofianeAmarouche commented 1 year ago

Please help if you can , I have the following test

Feature: websocket test operation

@websocket_test Scenario Outline: testing websockets

I noticed that when i use the handle within my scenario I get as follow

I tried to use warp the handle as follow but the error still persist

However when I dont include the handle like the following, the same error is not thrown

In my case I have the use the handle to return the desired response body and I tried to create a custom java method for the handler but it doesnt work it is giving the following error

Below is my test Background:

Below is is my java_handle() method in java

package javaUtilities;

public class javaKarate { public static Boolean java_handle(String msg){ return (msg.startsWith("{") && !msg.contains("context"));

}

}

I'm not sure what else I should do, not sure if there is an alternative the handle . Please help

ptrthomas commented 1 year ago

@sofianeAmarouche kindly follow the instructions here exactly. note that we should be able to run this locally and see the problem: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue