What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Run Rails system tests in GitLab CI either with Chrome and ChromeDriver available in the job container, or with a separate Selenium browser service. The right setup depends on your locked Rails, Ruby, and Selenium versions, database, runner executor, and whether the browser can reach the app container over the job network. Rails supports both local headless Chrome and a remote browser through SELENIUM_REMOTE_URL (Rails Testing Guide).
Choose where Chrome runs
Chrome in the job container
This is the simpler topology when your chosen job image includes a compatible Chrome installation and your tests run the browser in the same container as the Rails test process. Rails starts headless Chrome through Selenium; the app server and browser share the job container’s network namespace, so the browser can reach the local app server without configuring a second service hostname.
As an Amazon Associate I earn from qualifying purchases.
The trade-off is image maintenance: the job image must also have the required Ruby runtime, system libraries, database client tools, and browser dependencies. Use an image compatible with the project rather than assuming any generic Ruby image includes Chrome.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Selenium in a separate service container
A Selenium service keeps the browser separate from the job image. It is useful when you want a browser container or need to run the browser independently, but requires explicit network reachability in both directions: Rails must connect to Selenium, and the remote browser must be able to connect back to the Rails app server. Container-local localhost refers to that container itself, not its neighbor.
#1 Best Overall
GitLab’s Selenium Server project illustrates a service alias and endpoint, but that example is not a maintained, universal Rails recipe. Check the selected image’s current endpoint, readiness behavior, and compatibility before adapting it (GitLab Selenium Server project).
Configure Rails system tests
In the Rails system-test base class, choose remote mode only when the environment variable is present; otherwise use local Chrome. This follows the Rails guide’s documented pattern:
require "test_helper"
require "socket"
require "ipaddr"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
url = ENV.fetch("SELENIUM_REMOTE_URL", nil)
options = if url
{ browser: :remote, url: url }
else
{ browser: :chrome }
end
driven_by :selenium, using: :headless_chrome, options: options
if url
Capybara.server_host = "0.0.0.0"
Capybara.app_host = "http://#{IPSocket.getaddress(Socket.gethostname)}"
end
end
The remote-mode host settings are a starting pattern, not a universally correct address. The Rails test process binds the app server to all interfaces, then advertises an address that the browser container can route to. Depending on the runner network, you may need a service-visible hostname, explicit port, or other reachable address. Verify the address from inside the Selenium container. Rails specifically notes that remote-browser testing needs extra configuration so the browser can call the app (Rails Testing Guide).
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Rank #2
Build a GitLab CI job around your application
There is no universally valid .gitlab-ci.yml for every Rails app: Ruby and gem versions, database service, browser image, and runner executor differ. Start with this skeleton, then set the image and services to match the project’s .ruby-version, Gemfile.lock, database configuration, and chosen topology.
Local browser topology
stages:
- test
rails_system_tests:
stage: test
image: ruby:YOUR_RUBY_VERSION
services:
- name: postgres:YOUR_POSTGRES_VERSION
alias: db
variables:
RAILS_ENV: test
DATABASE_URL: "postgresql://postgres:YOUR_PASSWORD@db:5432/YOUR_TEST_DATABASE"
before_script:
- bundle install
- bin/rails db:prepare
script:
- bin/rails test:system
Replace the placeholder values with the application’s real versions and credentials, and use a Ruby job image that also provides the Chrome installation and system dependencies needed by the locked Selenium stack. Configure the test database using the project’s actual convention; do not assume PostgreSQL or the example variable names. If the project uses another database, select its matching service and configuration.
Remote Selenium topology
stages:
- test
rails_system_tests:
stage: test
image: ruby:YOUR_RUBY_VERSION
services:
- name: postgres:YOUR_POSTGRES_VERSION
alias: db
- name: YOUR_COMPATIBLE_SELENIUM_IMAGE
alias: selenium
variables:
RAILS_ENV: test
DATABASE_URL: "postgresql://postgres:YOUR_PASSWORD@db:5432/YOUR_TEST_DATABASE"
SELENIUM_REMOTE_URL: "http://selenium:4444/wd/hub"
before_script:
- bundle install
- bin/rails db:prepare
script:
- bin/rails test:system
The Selenium URL shown is illustrative; confirm the selected Selenium image’s actual endpoint and whether it requires a different path or readiness check. The alias selenium must resolve from the job container. Separately, the browser started by that service must resolve and reach the app address configured in Capybara. A working Rails-to-Selenium connection alone does not prove that the browser-to-app connection works.
Rank #3
Pin dependencies and choose compatible images
- Use the repository’s
.ruby-versionandGemfile.lockas the authority for Ruby and Selenium versions, and install dependencies reproducibly in CI. - Choose a browser setup that matches the locked Selenium version and the browser image. Avoid floating image tags when repeatable CI behavior matters.
- Make sure the job image contains database clients and any required build tools or libraries. GitLab documents an image containing Ruby, Chrome, Node, PostgreSQL, and other tools for its own repository; that composition is not a recommendation for every Rails project (GitLab CI configuration internals).
- Confirm the runner executor and service networking model. Docker-based services and shell runners do not necessarily expose the same network behavior or hostname routing.
Do you need to install ChromeDriver separately?
Not necessarily. GitLab’s frontend testing guide says Selenium Manager, included with selenium-webdriver, can manage ChromeDriver automatically starting with Selenium 4.6 (GitLab frontend testing guide). Check the Selenium version actually locked by your app before removing an existing driver-management step. Also account for runner network access and package restrictions, which can affect downloading a driver at runtime. With a remote Selenium service, the browser and its driver are generally provided by that service image, not installed into the Rails job container.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Size the runner for browser tests
System tests start the application stack and exercise it through a browser, so they generally cost more time and resources than tests that do not run a browser. In GitLab’s own CI documentation, jobs marked with GLCI_MEDIUM_RUNNER_REQUIRED are specified for runners with at least 4 cores and 16 GB RAM; the same guidance calls out increased compute demand for Chrome 133 and later. This is GitLab workload guidance, not a universal minimum for Rails projects. GitLab also warns that its app and PostgreSQL can become unpredictable when they share insufficient resources (GitLab CI configuration internals).
For your project, observe job duration, memory pressure, browser crashes, and database contention on the actual runner. Increasing capacity can help when resource exhaustion is the cause, but it will not fix a bad Selenium URL, an unreachable app host, or a browser/driver incompatibility.
Rank #4
Troubleshoot common failures
Selenium cannot start or the browser exits immediately
- Confirm that the selected image actually includes a browser and its required libraries, or that the Selenium service started successfully.
- Compare the locked
selenium-webdriverversion with the browser and driver setup. If Selenium Manager is expected to obtain ChromeDriver, check that the version is at least 4.6 and that the runner can access the required downloads. - Check runner logs for memory pressure or process termination before changing browser configuration.
The remote browser cannot open the Rails app
- Do not set the remote browser’s app host to
localhostunless Rails and the browser share that network namespace. - Set
Capybara.server_hostso the app server listens on a reachable interface, then setCapybara.app_hostto an address resolvable from the Selenium browser container. - Test hostname resolution and the app port from the Selenium service’s network. Ensure the port is reachable and the Rails app is listening before browser navigation.
The job cannot connect to the Selenium service
- Check that
SELENIUM_REMOTE_URLuses the CI service alias, notlocalhostor a host-only address. - Verify the service’s documented port and URL path for the chosen image and allow time for it to become ready.
- Remember that the job-to-service path and service-browser-to-app path are separate network connections; diagnose each independently.
Tests are flaky, slow, or killed on CI
- Distinguish resource exhaustion from test isolation problems. Inspect runner capacity and whether the app and database compete for the same resources.
- Keep browser-driven tests focused on behavior that needs a real browser. Use lower-level tests where they can verify behavior reliably.
- JavaScript-driver tests run the app and test code in separate threads. Data may need to be committed for the app to see it, and cleanup may need truncation rather than transaction rollback (GitLab testing levels).
How can I see the browser while debugging?
Rails headless Chrome is intended for headless CI use. GitLab documents WEBDRIVER_HEADLESS=false and, on another testing page, WEBDRIVER_HEADLESS=0 for visible-browser debugging in GitLab’s own workflow. These are GitLab project conventions, not Rails-wide environment variables; a Rails app honors them only if its own test configuration reads them (frontend testing guide; GitLab test-running guide). In a remote-browser setup, visibility also depends on how the Selenium browser is run and exposed.
Keep system-test coverage targeted
Use system tests for user-visible flows where browser behavior matters, such as JavaScript interactions, navigation, and page-level integration. They start more of the application stack than unit or service-level tests and can be slower, especially with a JavaScript driver. Keep the rest of the test suite at lower levels when those tests can establish the behavior reliably; commit test data when the separate app thread needs to read it and choose cleanup compatible with that setup (GitLab testing levels).
Free tools Windows power users keep installed
One-click scans. No signup required.
Or skip the browser setup
For a standalone webpage screenshot rather than an interactive Rails system test, ScreenshotNeo can capture a URL through one API request. It is a separate screenshot service, not a replacement for system tests that exercise your application’s workflows.
Best Value
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Learn about ScreenshotNeo or sign up free.
Frequently Asked Questions
Can I use the same Rails system-test class locally and in GitLab CI?
Yes. The example selects local Chrome unless `SELENIUM_REMOTE_URL` is set, so the same class can use different browser topologies by environment.
Does a green Selenium connection prove the remote browser can reach Rails?
No. The Rails job connecting to Selenium and the Selenium browser connecting back to the Rails app are separate network paths.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




