Setting Up a Web UI Automation Testing Environment on CentOS with Selenium, Chrome, and VNC
This guide explains how to configure a CentOS 7.1 test server for web UI automation by installing a GNOME desktop, VNC service, stable Chrome browser, Python pip, Selenium, and chromedriver, and demonstrates using Python multiprocessing to run concurrent browser‑based tests, dramatically reducing regression time.
Web UI automation testing often suffers from high maintenance overhead, but by applying proper configuration, isolation of locating and operating steps, and a well‑designed environment, the workload can be reduced.
Install GNOME desktop on the CentOS 7.1 server:
yum groupinstall "GNOME Desktop"
Install and configure VNC server to provide remote graphical access:
yum install tigervnc-server
Copy the service template and edit it:
/etc/systemd/system/vncserver@:1.service
[Unit] Description=Remote desktop service (VNC) After=syslog.target network.target [Service] Type=forking User=autotestuser ExecStart=/usr/bin/vncserver :1 -geometry 1280x1024 -depth 16 -securitytypes=none -fp /usr/share/X11/fonts/misc ExecStop=/usr/bin/vncserver -kill :1 [Install] WantedBy=multi-user.target
Enable and start the VNC service, then verify it is listening:
systemctl enable vncserver@:1.service systemctl start vncserver@:1.service netstat -lntp | grep vnc
Install the stable Google Chrome browser (ensure the repository is configured):
yum install google-chrome-stable
Install Python 2 pip and Selenium:
yum install python2-pip pip install -U selenium
Download the matching chromedriver from chromedriver site and place it in PATH or specify its location in scripts, making sure the driver version matches the Chrome version.
For large test suites, use Python's multiprocessing module to run tests in parallel across multiple browser instances, each in its own process, eliminating data dependencies and significantly shortening regression cycles.
By following these steps, a stable, scalable web UI automation environment is established, enabling efficient test execution and maintenance.
360 Tech Engineering
Official tech channel of 360, building the most professional technology aggregation platform for the brand.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.