{"record":{"id":"1b4e1302d46bf38b","repo":"karatelabs/karate","slug":"skipping-scenario-outline-in-mock","errorCode":null,"errorMessage":"skipping scenario outline in mock - {}:{}","messagePattern":"skipping scenario outline in mock - (.+?):(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"karate-core/src/main/java/io/karatelabs/core/MockHandler.java","lineNumber":402,"sourceCode":"\n        // Process body for form-urlencoded and multipart\n        request.processBody();\n\n        // Find matching scenario and execute\n        for (Feature feature : features) {\n            ScenarioRuntime runtime = runtimes.get(feature);\n            Engine engine = runtime.getEngine();\n\n            // Drop any values marked request-derived by a previous request before this one's\n            // bindings are read again, so the identity set never accumulates stale entries.\n            runtime.clearRequestDerived();\n\n            // Set up request variables (includes storing HttpRequest for matcher functions)\n            setupRequestVariables(engine, request);\n\n            for (FeatureSection section : feature.getSections()) {\n                if (section.isOutline()) {\n                    logger.warn(\"skipping scenario outline in mock - {}:{}\", feature, section.getScenarioOutline().getLine());\n                    continue;\n                }\n\n                Scenario scenario = section.getScenario();\n                if (isMatchingScenario(scenario, engine)) {\n                    return executeScenario(runtime, scenario, request);\n                }\n            }\n        }\n\n        // No match found - return 404\n        logger.warn(\"no scenarios matched, returning 404: {} {}\", request.getMethod(), request.getPath());\n        return createNotFoundResponse();\n    }\n\n    private HttpResponse handleCorsPreFlight(HttpRequest request) {\n        HttpResponse response = new HttpResponse();\n        response.setStatus(200);","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/karatelabs/karate/blob/a22eb90246d958d15a47bf436693d0121ad2812d/karate-core/src/main/java/io/karatelabs/core/MockHandler.java#L384-L420","documentation":"MockHandler iterates the feature's sections to find a scenario matching the incoming mock HTTP request. Scenario Outlines cannot be executed by the mock server (mocking resolves a single concrete scenario per request), so any outline section is skipped with this warning and matching continues with the plain scenarios.","triggerScenarios":"Starting a Karate mock server (Karate.mockServer / MockHandler) against a feature whose Scenario Outline blocks would be candidates for an incoming request; handleRequest then logs this per outline section and never uses the outline's Examples rows.","commonSituations":"Pointing a mock at a reused test feature file that contains outlines instead of authoring a dedicated mock feature; a refactor converts a scenario into an outline and mock coverage silently disappears; developers expecting Examples-based responses from the mock.","solutions":["Split the mock feature so each concrete case is a plain Scenario (no Examples) with the request matchers the mock should respond to.","Generate/unroll the outline rows into separate scenarios in the mock feature.","Keep a dedicated mock-only feature file separate from the test features.","If the outline behavior is needed, handle it in a custom mock implementation or request handler rather than a Scenario Outline."],"exampleFix":"// before\nScenario Outline: mock user\n  * def name = '<name>'\n  Examples: | name |\n           | bob |\n// after\nScenario: mock user bob\n  * def name = 'bob'","handlingStrategy":"validation","validationCode":"// Before starting the mock, assert the feature has no outlines\nfor (FeatureSection s : feature.getSections()) {\n    if (s.isOutline()) {\n        throw new IllegalStateException(\"mock feature must not contain Scenario Outline at line \" + s.getScenarioOutline().getLine());\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Author dedicated mock features with plain Scenarios only","Add a build-time check that scans mock features for Scenario Outline blocks","If data-driven mocking is needed, generate one scenario per Examples row instead"],"tags":["mock-server","scenario-outline","feature-file","skipped-scenario"],"backgroundTag":"unsupported-operation","analyzedSha":"a22eb90246d958d15a47bf436693d0121ad2812d","analyzedAt":"2026-09-12T09:01:00.220Z","contentChangedAt":"2026-09-12T09:01:00.220Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}