Should we need to add SeleniumVersion in pom.xml?

if we are running a Maven project and specified Selenium dependency, should I set the capability “SeleniumVersion” while running tests in pom.xml?

Hello Rhian,

There is no specific capability named “SeleniumVersion” that needs to be set explicitly when running tests with Selenium on LambdaTest. The Selenium version compatibility is generally managed by the Maven dependencies specified in your pom.xml file.

When working with LambdaTest and Selenium, you typically include the LambdaTest Selenium dependencies in your Maven project. These dependencies include the version of Selenium that is compatible with LambdaTest’s infrastructure.

Here’s a simplified example of how you might include the dependencies in your pom.xml:

<dependencies>
    <!-- Selenium Dependency -->
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version> <!-- Example version, check for the latest version -->
    </dependency>

    <!-- LambdaTest Selenium Dependency -->
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.14.3</version> <!-- Example version, check for the latest version -->
        <scope>test</scope>
    </dependency>
</dependencies>

Ensure that you include the Selenium version that is compatible with LambdaTest. LambdaTest may update its infrastructure to support newer versions of Selenium, so it’s a good practice to check the LambdaTest support documentation or contact their support to confirm the recommended Selenium version.

In summary, rather than setting a “SeleniumVersion” capability in the pom.xml, you should manage Selenium version compatibility through the dependencies specified in the Maven project file.

Always refer to LambdaTest’s documentation for the most up-to-date information on Selenium version compatibility.

Hope this answers your query :slight_smile: