0

I'm new to Java and Maven.

I'm following this tutorial about Cucumber in Java but it doesn't mention about Maven dependency such as groupId or artifactId of modules that related to Cucumber.

https://cucumber.netlify.app/docs/guides/browser-automation/

My question is that from information of the code base, how can I get information to insert to pom.xm?

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;
1

3 Answers 3

4

I think you specific question will be answered by looking into the cucumber installation guides.

Your general question ("How to find the Maven dependencies for given imports?") is not truly solvable. You can, of course, take the qualified class names and look them up in https://search.maven.org/, but this will at best narrow down the search, and probably won't tell you which exact versions of the artifacts you should use.

Sign up to request clarification or add additional context in comments.

Comments

1

As for the above classes following are the dependencies I use, But there can be compatibility issues with your requirements and versions. Try the below and see if works, else you will have to find it from the maven repository

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-api</artifactId>
        <version>3.141.59</version> <!--Not sure the version-->
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-firefox-driver</artifactId>
        <version>3.141.59</version> <!--Not sure the version-->
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-support</artifactId>
        <version>3.141.59</version> <!--Not sure the version-->
    </dependency>

Comments

1

Any stable released version should be good to use. Example, I see you can use 3.141.59 Like:

<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-api -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-api</artifactId>
    <version>3.141.59</version>
</dependency>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.