There is 1 update, 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-dde36b6e-d517-4ebc-af08-83e7e18d59a9 XWIKI-25588 In Progress

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

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-5c8ebddc-f930-4900-8c97-0763eb8fa47b Changes by Vincent Massol on 24/Oct/26 20:17
 
Status: Open In Progress
 
 

1 comment

 
cid:jira-generated-image-avatar-5c8ebddc-f930-4900-8c97-0763eb8fa47b Vincent Massol on 24/Oct/26 20:18
 
h3. 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.
h4. 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.
h4. 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.
h4. 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{}}}.

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