Junit 5 – No ParameterResolver registered for parameter

We Are Going To Discuss About Junit 5 – No ParameterResolver registered for parameter. So lets Start this Java Article.

Junit 5 – No ParameterResolver registered for parameter

  1. Junit 5 – No ParameterResolver registered for parameter

    This error appears when you try to use both @Test and @ParameterizedTest in the same test class. Removing @Test annotation will resolve the issue.

  2. Junit 5 – No ParameterResolver registered for parameter

    This error appears when you try to use both @Test and @ParameterizedTest in the same test class. Removing @Test annotation will resolve the issue.

Solution 1

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

Original Author Will Of This Content

Solution 2

This error appears when you try to use both @Test and @ParameterizedTest in the same test class. Removing @Test annotation will resolve the issue.

Original Author muhin Of This Content

Solution 3

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.

Original Author Sam Brannen Of This Content

Solution 4

I also got ParameterResolutionException with JUnit 5.

org.junit.jupiter.api.extension.ParameterResolutionException: 
No ParameterResolver registered for parameter [int[] arg0] in constructor (public my_package.MyClass(int[]))

I had written @Test methods inside the class I was testing.

This error could be fixed in two ways:

1) Either replacing import org.junit.jupiter.api.Test with import org.junit.Test, or

2) Writing tests in a separate TestClass.

Original Author Matilda Smeds Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment