Since I found the solution myself, I want to share. I will post only parts of the code to give hints, not the complete code, as it works a lot here, but for an experienced developer this should be enough.
In order to be able to access the correct browser and access its websocket remote debugger, I implemented my own servlet for my nodes.
First servlet:
public class DebugServlet extends RegistryBasedServlet
registered through node.json as
"servlets" :["com.....ui.util.DebugServlet"],
node ( ), , :
"http://" + hubHost + ":" + hubPort + "/grid/api/testsession?session=" + sessionId
"sessionid" .
json node , url.
url = JSONUtil.get(response.getBody(), "proxyId")
, URL- websocket . BasicAuth.
url+ "/extra/DebugServlet"
java ( , http)
new BasicHeader("BrowserUrl", webSocketDebuggerUrl), new BasicHeader("Name", name),
new BasicHeader("Value", value)
- URL- .
:
public static final String networkDebugging = "{\"id\": 1,\"method\": \"Network.enable\",\"params\": {\"maxTotalBufferSize\": 10000000,\"maxResourceBufferSize\": 5000000 }}";
public static final String addHeader = "{\"id\": 2,\"method\": \"Network.setExtraHTTPHeaders\",\"params\": { \"headers\": {\"${key}\": \"${value}\"}}}";
ws.connect();
ws.setAutoFlush(true);
ws.sendText(networkDebugging);
String payload = TemplateUtil.replace(addHeader, name, value);
ws.sendText(payload);