Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Setup your VM and install Ubuntu for example
    1. mount iso image in optical drive
  2. In VirtualBox preferences > Network > Host-only Networks, click the add icon
    • creates a new virtual network interface e.g. vboxnet0
       
  3. In VM Settings > Network
    • 1st slot: select "Host-only Adapter", then choose the one you just created — that vboxnet0
    • 2nd slot: select NAT as is usually the default (to access the interwebs through the host)
  4. Install guest additions
    • When VirtualBox VM is running
    • Devices > Insert Guest Additions CD image...

 

2. Selenium server setup

  1. Download Selenium Server (formerly the Selenium RC Server)
  2. Adjust AbstractMagnoliaUITest — locally only
    • Basically replace the FirefoxDriver with a RemoteWebDriver
    • pass on the URL of your selenium server
    • default URL is something like http://{your-hostname.local}:4444/wd/hub
    • pass the FirefoxProfile along through the DesiredCapabilities
    • Code Block
      languagejava
      titleAbstractMagnoliaUITest.java
      URL seleniumServerUrl = null;
      try {
          String vmHostName = "your-vm-hostname";
          seleniumServerUrl = new URL(String.format("http://%s.local:4444/wd/hub", vmHostName));
      } catch (MalformedURLException e1) {}
      DesiredCapabilities capabilities = DesiredCapabilities.firefox();
      capabilities.setCapability(FirefoxDriver.PROFILE, firefoxProfile);
      driver = new RemoteWebDriver(seleniumServerUrl, capabilities);
    • Check out the attached patch file: remote-webdriver.patch
  3. Adjust the DEFAULT_DOMAIN constant as well, in AbstractMagnoliaIntegrationTest — locally only
    • should be your machine's hostname or IP address as to be reachable from the guest
    • e.g. http://mymachine.local:8299/

 

3. Fancy shell script + desktop launcher for the Selenium server

...