Get URL when using WebdriverIO


Using WebdriverIO for testing an Electron app.

I can get current url with client.url() as below. Thought you cannot navigate to a URL using it since Electron uses BrowserWindow.loadUrl() to do that.

# get current URL
var webdriverio = require('webdriverio');
var client = webdriverio.remote(options);

client.url(function(err, res){

But the problem is that if Electron client navigates to a remote URL like using BrowserWindow.loadUrl(), then the Webdriver client does not proceed to next chained action.

  .url(function(err, res){
      # Problem! Cannot reach here.

The Electron client uses ipc.send() to handle event and the event handler is as below.

ipc.on('loadUrl', function(event, url){

I didn’t send back ipc reply since the caller window would not get the reply anyway.


After helpful discussion with webdriverio project owner, this issue is likely due to chromedriver and submitted as Issue 1207.