How to Fix No Tests Found for Given Includes Error in Test Frameworks?
On This Page What is the “ No Tests Found for Given Includes ” Error?April 01, 2026 · 7 min read · Testing Guide
While working with exam frameworks, particularly, developers often face a lot of errors that delay the execution of their tests. One very common error substance is the “No Tests Found for Given Includes” fault. This error generally come when the test runner can ’ t identify or locate the tests free-base on the provided configuration. Mutual Causes of & # 8220; No Tests Found for Given Includes & # 8221; Error How to Solve the & # 8220; No Tests Found for Given Includes & # 8221; Error? In this article, learn more about the causes of this error and how to resolve it so that the development summons can be politic and effective. The “ No Tests Found for Given Includes ” fault occurs when the test contrabandist (like Gradle or IntelliJ IDEA) can not find or recognise the test methods mentioned in the project. This can be due to respective reasons, such ascontour issues, incorrect annotations, or mismatched addiction. When this error comes, it mean that the tryout framework couldn ’ t locate any tests based on the standard or examination classes render. It usually indicates a misconfiguration or a setup matter that prevents the fabric from running the tests. Read More: Multiple topic can lead to the “ No Tests Found for Given Includes ” error. Some of the common issues are: In Gradle-based projects,build.gradlefile contains significant information about the location and running of the tests. If this file is not correctly configure or lacks significant dependencies, the test framework may miscarry to know or run the tests. Read More: In JUnit-based labor, the @ Test annotation marks a method as a test. However, if the incorrect annotating is imported from a different library, such as JUnit 4 rather of JUnit 5, this can direct to conflicts and the error message “ No Tests Found for Given Includes ”. If the project uses a mix of different versions of the testing model (for example, JUnit 4 and JUnit 5), compatibility issues can prevent the trial from being agnize or executed properly. This version mismatch can trigger the fault. Sometimes, test execution may neglect because of Gradle-specific issues such as incorrect task form or lose test performance background. This may prevent tests from being detected, leading to an mistake. Test folders sometimes need a specific folder structure for source and examination files. If the directory are misalign (for instance, if your trial files are placed outside the standard src/test/java directory, the test moon-curser may not discover the tests, lead in an erroneousness. Read More: Here are some of the step to clear the “ No Tests Found for Given Includes ” error: Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script. Always ensure that build.gradle file bear all the necessary contour to run tests. For JUnit 5, include the JUnit dependency and test plugin. Here ’ s the example configuration: Do check that the @ Test annotation is imported from the correct JUnit variation, so as to avoid any variety of fault. For JUnit 5, importee it from: For JUnit 4, signification it from: While using JUnit 5, it ’ s important to control that all the libraries are compatible. Using JUnit 5 libraries will raise the desegregation with modernistic creature and eliminate conflicts with legacy versions. Read More: In order to run both JUnit 4 and JUnit 5 tests in the same project, include the JUnit 5 Vintage Engine to permit compatibility for JUnit 4 examination within a JUnit 5 environment. Add this dependency to build.gradle: If test are run on both JUnit 4 and JUnit 5, ensure that the dependencies are in the build.gradle file is set up correctly to handle both: Sometimes, IDE-specific configurations may be causing the issue. Running trial directly from IntelliJ IDEA often resolves such issues by ensuring compatibility between your undertaking setup and trial configuration. Source: Stackoverflow Ensure that the project ’ s brochure structure aligns with the expected frame-up. In a distinctive Gradle project, tryout classes should be under src/test/java. If examination classes are placed elsewhere, move them to the right location. Here are some of the best practice to prevent this error in the future: Follow consistent naming conventions for the tryout classes and methods. This will help test frameworks recognize and run the tests more easy. Here ’ s an example of how to configure Gradle to recognize JUnit tests using the nonremittal naming rule: Regularly review and update build.grade and other configuration file to ensure they are set up properly and remain compatible with the latest testing frameworks. Use tools like Maven or Gradle to automate dependency management. This ensure that essay libraries are up-to-date and compatible with each former. Executing or running JUnit tests on a reliable, scalable, and consistent platform is important for maintaining the quality and stability of the package. offers a full-bodied cloud-based solution that makes JUnit testing easy and integrates seamlessly into the pipeline. Here are some of the reasons why BrowserStack Automate is an ideal selection for running JUnit test: The “NoTests Found for Given Includes ” error can be specify with proper configuration, correct imports, and version management. By following some of the best practices and using reliable instrument like, enhance your testing experience and prevent these errors from recurring. It improves your testing process, providing better compatibility, and a politic experience. Try BrowserStack Now On This Page # Ask-and-Contributeabout this topic with our Discord community. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.How to Fix No Tests Found for Given Includes Error in Test Frameworks?
Overview
What is the “ No Tests Found for Given Includes ” Error?
What are the common causes of “ No Tests Found for Given Includes ” Error?
1. Missing or Improper Configuration in build.gradle
2. Incorrect Import of @ Test Annotation
3. Framework Version or Compatibility Mismatch
4. Issues with Gradle Test Execution
5. Misaligned Folder Structure Between Test and Source Directories
How to Solve the “ No Tests Found for Given Includes ” Error?
1. Update and Complete the build.gradle Configuration
dependence {testImplementation 'org.junit.jupiter: junit-jupiter-api:5.7.0' testImplementation 'org.junit.jupiter: junit-jupiter-engine:5.7.0'} test {useJUnitPlatform ()}2. Ensure the Correct Library is Used for @ Test Annotation Import
signification org.junit.jupiter.api.Test;
significance org.junit.Test;
3. Use a JUnit 5 -Compatible Library for Better Integration
4. Include the JUnit 5 Vintage Engine for Legacy Support
testImplementation 'org.junit.jupiter: junit-jupiter-engine:5.7.0' testImplementation 'org.junit.vintage: junit-vintage-engine:5.7.0 '
5. Manage Dependencies to Run JUnit 4 and JUnit 5 Tests Together
testImplementation 'org.junit.jupiter: junit-jupiter-api:5.7.0' testImplementation 'org.junit.jupiter: junit-jupiter-engine:5.7.0' testImplementation 'org.junit.vintage: junit-vintage-engine:5.7.0 '
6. Execute Tests Using IntelliJ IDEA for Enhanced Compatibility
7. Align the Hierarchies of Your Test and Source Directories
Best Practices to Follow to Avoid the “ No Tests Found for Given Includes ” Error
1. Establishing Consistent Naming Conventions
plugins {id 'java' id 'junit '} repositories {mavenCentral ()} colony {testImplementation 'org.junit.jupiter: junit-jupiter-api:5.7.1' testRuntimeOnly 'org.junit.jupiter: junit-jupiter-engine:5.7.1'} test {useJUnitPlatform () include ' * * / * Test.class' include ' * * / * Tests.class' testLogging {event `` PASSED '', `` FAILED '', `` SKIPPED '' showStandardStreams = true}}2. Regularly Reviewing and Updating Configuration Files
3. Implementing Automated Dependency Management
Why choose BrowserStack to execute JUnit Tests?
Conclusion
Related Guides
Automate This With SUSA
Test Your App Autonomously