Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: mention change of DEFAULT_DOMAIN constant too (for the VM to access the webapp on the host)

...

  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 in the attachments!remote-webdriver.patch

...

  1. 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

  1. Create a new script, e.g. selenium-server on the desktop as follows
    • provided your selenium server jar is on the desktop too)
    • Code Block
      languagebash
      titleselenium-server.sh
      #!/bin/bash
      gnome-terminal -e "java -jar selenium-server-standalone-2.42.2.jar"
  2. Make it executable
    • chmod +x your-script
    • Go to Nautilus (eq. Finder) preferences
      • Edit > Preferences, "Behavior" tab
      • Tick "Run executable text files when they are opened"

  3. The fancy icon
    • Select your script, right-click and go to the file Properties > Click the icon and select yours

Double-click your script and you're good to go! (smile)

...