Webdriverio: Attach the sessionID of a browser instance to webdriverIO

Created on 19 Feb 2016  路  2Comments  路  Source: webdriverio/webdriverio

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?

Most helpful comment

@christian-bromann i resolved my problem like this:
-client.requestHandler.sessionId = startedSessionId;
+client.requestHandler.sessionID = startedSessionId;
thanks!

All 2 comments

@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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eawer picture eawer  路  4Comments

aminerouh picture aminerouh  路  3Comments

briancullinan picture briancullinan  路  4Comments

christian-bromann picture christian-bromann  路  3Comments

grofit picture grofit  路  4Comments