close

[Solved] Junit 5 – No ParameterResolver registered for parameter

Hello Guys, How are you all? Hope You all Are Fine. Today I am facing the following error Junit 5 – No ParameterResolver registered for parameter in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Junit 5 – No ParameterResolver registered for parameter Error Occurs?

Today I am facing the following error Junit 5 – No ParameterResolver registered for parameter in Java.

How To Solve Junit 5 – No ParameterResolver registered for parameter Error ?

  1. How To Solve Junit 5 – No ParameterResolver registered for parameter Error ?

    To Solve Junit 5 – No ParameterResolver registered for parameter Error I had both @Test and @ParameterizedTest annotating the same method. I removed the former.

  2. Junit 5 – No ParameterResolver registered for parameter

    To Solve Junit 5 – No ParameterResolver registered for parameter Error I had both @Test and @ParameterizedTest annotating the same method. I removed the former.

Solution 1

As Marc Philipp mentioned in his comment, you need to ensure that JUnit Jupiter can instantiate your test class.

For your particular scenario, you’ll need to remove your custom constructor that accepts a WebDriver.

Then you have two options:

  1. Create the WebDriver on your own — for example, in an @BeforeAll or @BeforeEach method.
  2. Use an extension such as Selenium Jupiter to help manage the WebDriver for you.

Solution 2

I had both @Test and @ParameterizedTest annotating the same method. I removed the former.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read