Hi i'm trying to attach the sessionID of a started browser instance to webdriverIO 2.4.5. But this doesn't. The browser instance has been started from a java project and sent through restful service to the nodejs project (the nodejs project is using webdriverIO/webdriverCSS). here my code:
var webdriverIO = require('webdriverio');
var client = webdriverIO.remote({
host: '10.130.114.2',
port: 4444,
logLevel: 'debug'
});
client.requestHandler.sessionId = startedSessionId;
unfortunately i get this error:
[15:45:16]: ERROR Couldn't get a session ID - undefined
/path_to_my_project/node_modules/webdriverio/lib/utils/PromiseHandler.js:154
throw error;
^
RuntimeError: RuntimeError
(UnknownError:13) An unknown server-side error occurred while processing the command.
Problem: Session [(null externalkey)] not available and is not among the last 1000 terminated sessions.
Active sessions are[]
Callstack:
-> url("http://www.myurl.com")
@christian-bromann any idea?
@cwandja yeah, you need to call init first and wait until this command has finished. After calling remote you haven't initialised a session.
@christian-bromann i resolved my problem like this:
-client.requestHandler.sessionId = startedSessionId;
+client.requestHandler.sessionID = startedSessionId;
thanks!
Most helpful comment
@christian-bromann i resolved my problem like this:
-client.requestHandler.sessionId = startedSessionId;+client.requestHandler.sessionID = startedSessionId;thanks!