There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-4bf9642e-6967-44c8-9995-c93aec255d98 XWIKI-25588 Open

Legacy functional tests fail to start Firefox because WebDriverManager cannot download geckodriver

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-c79bf26e-f440-4599-b071-1655369cdf88 Parth Rana on 24/Oct/26 19:16
 

Proposed Solution: Use Selenium Manager for Browser Driver Resolution

I suggest relying on Selenium Manager, which has been bundled with Selenium since version 4.6, instead of explicitly invoking WebDriverManager to configure browser drivers.

1. Update WebDriverFactory.java

File:
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/src/main/java/org/xwiki/test/ui/WebDriverFactory.java

Remove the explicit WebDriverManager setup call:

 

WebDriverManager.firefoxdriver().setup();

The Firefox driver can then be created directly:

 

driver = new FirefoxDriver(options);

Selenium Manager automatically locates an available driver or resolves and downloads a compatible driver when necessary.

To disable Selenium Manager usage statistics, configure the SE_AVOID_STATS system property before creating the WebDriver instance:

 

{{private static final String SE_AVOID_STATS = "SE_AVOID_STATS";

private void disableSeleniumManagerStatistics()
{
if (System.getProperty(SE_AVOID_STATS) == null
&& System.getenv(SE_AVOID_STATS) == null)

{ System.setProperty(SE_AVOID_STATS, "true"); }

}}}

Call disableSeleniumManagerStatistics() from createWebDriver() before initializing the browser driver. This follows XWiki's existing factory-level approach and preserves any value explicitly configured through a system property or environment variable.

2. Remove the Unnecessary Transitive Dependency

File:
xwiki-platform-core/xwiki-platform-test/xwiki-platform-test-ui/pom.xml

If WebDriverManager is no longer required elsewhere, ensure it is not retained through transitive dependencies. In particular, exclude io.github.bonigarcia:webdrivermanager from the com.deque.html.axe-core:selenium dependency, as appropriate for the targeted branch.

3. Benefits

  • Reduces reliance on an additional browser-driver management library.
  • Uses Selenium's native driver-resolution mechanism.
  • Avoids unnecessary dependency duplication.
  • Disables Selenium Manager statistics by default without overriding explicit user configuration.
  • Keeps driver initialization centralized in XWiki's existing WebDriverFactory.

4. Validation

After applying the changes, verify that the UI test framework can initialize Firefox in both local and CI environments, including environments where geckodriver must be downloaded. Also check that existing browser-specific options and UI test behavior remain unchanged.

Recommendation: Use Selenium Manager as the default driver-resolution mechanism, while retaining explicit driver configuration for environments that require it. Before opening a PR, check the target branch because the current master branch already appears to contain this implementation.