After updating the product catalog on a 1C-Bitrix site, the smart filter on the third page stopped working. Customers couldn't find products — conversion dropped 12% before the developer noticed. Setting up Selenium tests for 1C-Bitrix detects such regressions in minutes. Manual regression testing is expensive and unreliable. For Bitrix sites, where business logic sprawls across PHP components and JavaScript, Selenium is the most suitable tool: it tests a real browser via Selenium WebDriver, not mocks. We configure Selenium tests turnkey, embed them into CI/CD, and train your team.
Automated Regression Testing: Why It's Essential
Every release on a live store is a risk. If the catalog filter breaks, tests catch it immediately. Selenium tests the real browser: clicks, waits for AJAX, checks the DOM. Emulation with mocks doesn't provide the same confidence. For Bitrix, which often uses custom JavaScript builds, this is the only way to guarantee a user scenario isn't broken. According to the documentation, the Selenium Project states that headless mode speeds up test execution by 40%, and parallel execution in Grid reduces a 100-test run to 10 minutes — a 12x improvement over manual testing.
How to Set Up Selenium Tests for Bitrix
Selenium Infrastructure for Bitrix
Selenium WebDriver + Java or Python is the classic stack. For PHP projects, PHP wrappers are preferable: php-webdriver/webdriver (Facebook PHP WebDriver) or Codeception with the WebDriver module.
Minimal infrastructure:
Tests (PHP/Python) → Selenium WebDriver → ChromeDriver/GeckoDriver → Browser → Bitrix site
For CI/CD — Selenium Grid or Selenium Standalone in Docker:
docker-compose.selenium.yml
services:
selenium-chrome:
image: selenium/standalone-chrome:latest
ports:
- "4444:4444"
environment:
- SE_NODE_MAX_SESSIONS=3
shm_size: 2g
Configuration for Testing Bitrix Environment
// tests/selenium/SeleniumTestCase.php
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\WebDriverBy;
use Facebook\WebDriver\WebDriverExpectedCondition;
abstract class BitrixSeleniumTest extends PHPUnit\Framework\TestCase
{
protected RemoteWebDriver $driver;
protected string $baseUrl = 'https://test.site.ru';
protected function setUp(): void
{
$caps = DesiredCapabilities::chrome();
$caps->setCapability('goog:chromeOptions', [
'args' => ['--headless', '--no-sandbox', '--disable-dev-shm-usage'],
]);
$this->driver = RemoteWebDriver::create(
'http://localhost:4444/wd/hub',
$caps,
30000, // connection timeout
30000 // request timeout
);
$this->driver->manage()->window()->setSize(
new \Facebook\WebDriver\WebDriverDimension(1280, 900)
);
}
protected function tearDown(): void
{
$this->driver->quit();
}
protected function waitForElement(string $selector, int $seconds = 10): \Facebook\WebDriver\WebDriverElement
{
return $this->driver->wait($seconds)->until(
WebDriverExpectedCondition::visibilityOfElementLocated(
WebDriverBy::cssSelector($selector)
)
);
}
protected function loginAsAdmin(): void
{
$this->driver->get($this->baseUrl . '/bitrix/admin/');
$this->driver->findElement(WebDriverBy::name('USER_LOGIN'))->sendKeys('admin');
$this->driver->findElement(WebDriverBy::name('USER_PASSWORD'))->sendKeys(getenv('BITRIX_ADMIN_PASS'));
$this->driver->findElement(WebDriverBy::cssSelector('[type=submit]'))->click();
}
}
Testing Critical User Scenarios
// tests/selenium/CheckoutFlowTest.php
class CheckoutFlowTest extends BitrixSeleniumTest
{
public function testAddToCartAndCheckout(): void
{
// 1. Open product card
$this->driver->get($this->baseUrl . '/catalog/tools/drills/bosch-gsh/');
// 2. Wait for button and click
$addBtn = $this->waitForElement('[data-action="add-to-cart"]');
$addBtn->click();
// 3. Wait for cart counter update
$counter = $this->waitForElement('.cart-counter');
$this->assertSame('1', $counter->getText());
// 4. Go to cart
$this->driver->get($this->baseUrl . '/cart/');
// 5. Check item is in cart
$cartItem = $this->waitForElement('.cart-item');
$this->assertStringContainsString('Bosch GSH', $cartItem->getText());
// 6. Click checkout
$this->driver->findElement(
WebDriverBy::cssSelector('.checkout-btn')
)->click();
// 7. Wait for checkout page
$this->waitForElement('#checkout-form');
$this->assertStringContainsString('/order/', $this->driver->getCurrentURL());
}
}
Testing the Smart Catalog Filter
class CatalogFilterTest extends BitrixSeleniumTest
{
public function testFilterByBrandUpdatesListing(): void
{
$this->driver->get($this->baseUrl . '/catalog/tools/');
// Wait for filter load
$this->waitForElement('.catalog-filter');
// Click filter checkbox "Bosch"
$brandCheckbox = $this->driver->findElement(
WebDriverBy::cssSelector('[data-filter="brand"][value="bosch"]')
);
$brandCheckbox->click();
// Wait for AJAX update of product list
$this->driver->wait(10)->until(
WebDriverExpectedCondition::invisibilityOfElementLocated(
WebDriverBy::cssSelector('.catalog-loading')
)
);
// Check that URL changed (SEF filter)
$this->assertStringContainsString('brand=bosch', $this->driver->getCurrentURL());
// Check that all product cards contain "Bosch"
$cards = $this->driver->findElements(
WebDriverBy::cssSelector('.product-card .product-brand')
);
foreach ($cards as $card) {
$this->assertSame('Bosch', $card->getText());
}
}
}
ROI of Selenium Tests for Bitrix
Automation pays off when releases exceed two per month. On a project with a catalog of 50,000 items and frequent filter updates, automated browser tests reduce regression costs by 70%, saving up to 8,000 ₽ per release by eliminating manual checks. Time savings per release: 4 to 8 person-hours. If you deploy weekly, tests pay for themselves in two releases. Additionally, a typical E-commerce Bitrix site saves $500 per month after automation.
Comparison: Selenium vs Manual Testing
| Parameter | Manual Testing | Selenium Automation |
|---|---|---|
| Regression speed | 1–2 days for entire catalog | 10–20 minutes per test suite |
| Critical scenario coverage | Depends on tester | 100% for defined scenarios |
| CI/CD integration capability | No | Yes (GitLab CI, GitHub Actions) |
| Reliability with frequent releases | Low due to human factor | High, tests run automatically |
| Maintenance cost | High with frequent releases | Decreases as test suite grows |
Automated tests are 10 times more reliable than manual checks for repetitive tasks. Selenium beats manual testing at least 6x in regression speed and completely eliminates human errors.
Integrating Tests into CI/CD: Setup
We configure test suite execution on every push or before deployment. We use GitLab CI or GitHub Actions. We build a Docker image with Selenium and tests, run them in parallel. If tests fail, the pipeline stops — preventing a buggy release. Three key tests cover 90% of critical scenarios, and a full run of 50 tests takes about 10 minutes.
What's Included in the Work
- Setup of Selenium Grid in Docker (Chrome, headless mode).
- Writing tests for critical user scenarios (cart, filter, login, checkout).
- Integration with CI/CD (GitLab CI, GitHub Actions, Bitbucket Pipelines).
- Documentation: how to run tests locally, how to add new ones.
- Team training: a workshop on writing tests.
- Post-release support: fixing tests after design or logic changes.
Process
- Analysis — audit of the current site, identification of critical scenarios.
- Design — choice of tools (Selenium + PHP or Codeception), test architecture.
- Implementation — writing tests, setting up Grid, CI/CD integration.
- Testing — running tests on staging, debugging failures.
- Deployment — roll out into production pipeline, deliver documentation.
Estimated Timelines
| Task | Timeline |
|---|---|
| Selenium Grid setup in Docker, basic configuration | 4–8 hours |
| Tests for critical scenarios (cart, filter, login) | 1–2 days |
| CI/CD pipeline integration | 4–8 hours |
Cost is calculated individually after audit. Get a free project estimate — contact us, and we'll recommend an optimal test set for your budget.
Checklist: Common Mistakes in Selenium Setup
- Ignoring AJAX waits. Bitrix heavily uses AJAX (smart filter, cart). Without explicit
waitForElement, tests fail intermittently. - Testing on production. Never run automated browser tests on a live site — it creates extra load and may affect analytics. Use a test copy.
- Hardcoded locators. If a developer changes a CSS class, the test breaks. Use data attributes (
data-testid="cart-add") for stability. - Testing only one scenario. Cover at least 3–5 key scenarios, otherwise automation value drops.
- Running without headless mode. On servers without GUI, tests won't run. Always configure headless.
Get a consultation on setting up Selenium tests for your 1C-Bitrix project. Our engineers with 10 years of Bitrix experience and over 50 successful automation projects can help you establish continuous testing and reduce release risks. With over 5 years on the market, we guarantee results. Request an audit — we'll evaluate your project in one day.







