blueimp / wdio

Docker setup for WebdriverIO with automatic screenshots, image diffing and screen recording support for containerized versions of Chrome and Firefox on Linux, mobile versions of Chrome and Firefox on Android as well as Safari on iOS, Safari on macOS and Edge on Windows.
https://hub.docker.com/r/blueimp/wdio
MIT License
296 stars 51 forks source link

Question: Mac (host machine) cannot connect to Windows vm #10

Closed kumarpatel closed 4 years ago

kumarpatel commented 4 years ago

I've followed all the steps described here. https://github.com/blueimp/wdio#internet-explorer

Here's my .env file

SERVER_HOST=192.168.94.1
# SERVER_PORT=8080
# WINDOWS_HOST=10.0.2.15 # Got my host ip with *ipconfig* in command prompt
WINDOWS_HOST=10.0.2.2 # I've tried this as well. same output.
WINDOWS_ASSETS_DIR=C:\Users\IEUser\Documents\assets\

Running the test gives me the following output

Starting kumarwdio_chromedriver_1 ... done
Starting kumarwdio_geckodriver_1  ... done
Starting kumarwdio_mailhog_1      ... done
Starting kumarwdio_example_1      ... done
Waiting for host: chromedriver:4444 ... ok
Waiting for host: geckodriver:4444  ... ok
Waiting for host: example:8080      ... ok
1
Execution of 1 spec files started at 2019-10-28T22:31:10.410Z

2019-10-28T22:31:10.418Z INFO @wdio/cli:Launcher: Run onPrepare hook
2019-10-28T22:31:10.426Z INFO @wdio/local-runner: Start worker 0-0 with arg: ie
[0-0] RUNNING in internet explorer - /test/specs/test.spec.js
[0-0] 2019-10-28T22:31:10.739Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2019-10-28T22:31:11.955Z DEBUG @wdio/local-runner:utils: init remote session
[0-0] 2019-10-28T22:31:12.060Z INFO webdriver: [POST] http://10.0.2.2:4445/session
[0-0] 2019-10-28T22:31:12.061Z INFO webdriver: DATA { capabilities:
   { alwaysMatch: { browserName: 'internet explorer' },
     firstMatch: [ {} ] },
  desiredCapabilities: { browserName: 'internet explorer' } }
[0-0] 2019-10-28T22:32:27.283Z WARN webdriver: Request failed due to connect ECONNREFUSED 10.0.2.2:4445
[0-0] 2019-10-28T22:32:27.283Z INFO webdriver: Retrying 1/3
2019-10-28T22:32:27.283Z INFO webdriver: [POST] http://10.0.2.2:4445/session
[0-0] 2019-10-28T22:32:27.283Z INFO webdriver: DATA { capabilities:
   { alwaysMatch: { browserName: 'internet explorer' },
     firstMatch: [ {} ] },
  desiredCapabilities: { browserName: 'internet explorer' } }

Maybe my SERVER_HOST is not correct, but it doesn't seem like that matters since it's getting stuck in the Mac -> Windows VM communication.

Is there anything I'm doing wrong?

kumarpatel commented 4 years ago

nvm. Got it working. Had to do with my Windows VM Network settings. Had to setup 2 network adaptors.

  1. Host-only Adapter, 'vboxnet0'
  2. NAT
blueimp commented 4 years ago

Thanks for posting your solution!