Selenium 3 upgrade guide
We plan to upgrade the version of Selenium provided by Confluence in our Confluence 8.6 release. To ensure a smooth rollout, we've provided a way to test your apps well ahead of time.
This page contains instructions to test your apps with Selenium 3, and the latest information about the upgrade.
What is changing?
We will upgrade Selenium from 2.x to 3.x in Confluence 8.6. Work for this has already started internally.
If your app has tests that use the version of Selenium provided by Confluence, then it’s possible some of your tests may break when you update your app to use Confluence 8.6.
Note: We previously stated that the Selenium upgrade would happen in Confluence 8.5. This has been updated since Confluence 8.5 is an Long Term Support release and we don't want to introduce any potential breaking changes here.
Preparing to upgrade
Nothing needs to be done urgently, but you should figure out if your tests will need to be updated in the future.
The current default test module provided by Confluence is Selenium 2.5.11, so we’ve shipped another test module in Confluence 8.2.0 that provides Selenium 3.3.2 as an additional and optional module for you to test with. If you wish to test your app with Selenium 3, simply modify the pom in your app to use this new test module.
Test your app with Selenium 3.x
In the </dependencyManagement>
of your pom.xml, update confluence-plugins-platform-test-pom
to confluence-plugins-platform-test-selenium3-pom
and set the version to at least Confluence 8.2.0.
The new test pom can provide the following:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.atlassian.confluence</groupId>
<artifactId>confluence-stateless-test-runner</artifactId>
<version>8.0.5</version>
</dependency>
<dependency>
<groupId>com.atlassian.confluence</groupId>
<artifactId>confluence-webdriver-pageobjects</artifactId>
<version>11.4.12</version>
</dependency>
<dependency>
<groupId>com.atlassian.selenium</groupId>
<artifactId>atlassian-webdriver-core</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>com.atlassian.selenium</groupId>
<artifactId>atlassian-pageobjects-elements</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>com.atlassian.selenium</groupId>
<artifactId>atlassian-pageobjects-elements-aui</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>com.atlassian.browsers</groupId>
<artifactId>atlassian-browsers-auto</artifactId>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>5.1.0</version>
</dependency>
</dependencies>
</dependencyManagement>
In your app, you can define which dependencies you want to use from the new test module and confirm them with mvn dependency:tree
.
Troubleshooting
What if my tests are broken?
After moving from Selenium 2 to Selenium 3, some of your existing Selenium tests may be broken.
There's usually not too much work involved in updating tests for Selenium 3.
The table below lists some basic examples to be used as a starting point to fix broken tests. We'll continue to add to this as we come across more examples. This won't be an exhaustive list as we don’t know the exact way your tests are written.
Error | Solution |
---|---|
| Inject WebDriver from Selenium instead |
| Inject JavascriptExecutor and use the method from it instead
|
cannot find symbol [ERROR] symbol: method waitUntilElementIsNotLocated(org.openqa.selenium.By) | Replace with Poller.waitUntil* methods instead
|
| Replace with com.atlassian.webdriver.utils.Check#elementExists/elementIsVisible |
[ERROR] symbol: class Waiter | Replace such usages with its equivalent com.atlassian.pageobjects.elements.query.Poller.waitUntil* methods or WebDriverPoller where applicable |
| Replace with {{Poller.waitUntilTrue(element.timed().isPresent()); |
| Replace with new Actions(driver).sendKeys().perform; |
| Inject BrowserAware interface and use it to get browser. |
| Replace with MoreExecutors.newDirectExecutorService() |
| Poller. waitUntilTrue(pageElementFinder.find(By.id(".create-dialog-create-button")).timed().isEnabled()); |
| org.openqa.selenium.interactions.Locatable; |
| Replace with com.atlassian.pageobjects.browser.RequireBrowser |
If the plugin is using an older version of Jira, it’s likely it brings AtlassianWebDriver and causes compile errors. | Upgrade to at least Jira 8.20.20 Long Term Support release |
Errors related to Jira objects from package: com.atlassian.webdriver.jira | Replace with com.atlassian.jira.pageobjects |
Problems related to pageobjects such as ConfluenceTestedProduct:
| Make sure to use the classes from confluence-webdriver-pageobjects instead of Confluence core. com.atlassian.confluence.webdriver.pageobjects.ConfluenceTestedProduct |
Any class which extends AbstractInjectableWebDriverTest | Replace with ConfluenceStatelessTestRunner. More information to be added soon. |
| Replace with relevant classes from |