When I am executing Scenario Outline it is executing multiple times from given statements(JVM Cuumber)












0














When I am executing Scenario Outline it is executing multiple times from starting of the scenario outline, I know it will execute multiple times based on the test data but when if we executing scenario outline it should not execute from give Statement every time, it has to execute the Example Multiple times.
How to solve this issues.



@Workflow
Scenario Outline: Perform
Given I click on Maglink
When I Click AllMagLink & Select Exception on Advanced Filters
And I Send the Value After Reading Form ExcelSheet
And I Click on Search
And I Click on subregLink
And I Get The xxxx From xxxx Tab
Then I Click on <Tabs> and Validate it in AllTasks

Examples:
|Tabs |
|Apple |
|Mango |
| PineApple |









share|improve this question






















  • Scenariooutline will repeat each step for each row of the examples table. That is what it does. There is no such existinh feature to repeat a step of a scenario. What u can try is use a datatable instead of examples. Then iterate the datatable in the stepdef method with necessary details.
    – Grasshopper
    Nov 21 '18 at 3:21
















0














When I am executing Scenario Outline it is executing multiple times from starting of the scenario outline, I know it will execute multiple times based on the test data but when if we executing scenario outline it should not execute from give Statement every time, it has to execute the Example Multiple times.
How to solve this issues.



@Workflow
Scenario Outline: Perform
Given I click on Maglink
When I Click AllMagLink & Select Exception on Advanced Filters
And I Send the Value After Reading Form ExcelSheet
And I Click on Search
And I Click on subregLink
And I Get The xxxx From xxxx Tab
Then I Click on <Tabs> and Validate it in AllTasks

Examples:
|Tabs |
|Apple |
|Mango |
| PineApple |









share|improve this question






















  • Scenariooutline will repeat each step for each row of the examples table. That is what it does. There is no such existinh feature to repeat a step of a scenario. What u can try is use a datatable instead of examples. Then iterate the datatable in the stepdef method with necessary details.
    – Grasshopper
    Nov 21 '18 at 3:21














0












0








0







When I am executing Scenario Outline it is executing multiple times from starting of the scenario outline, I know it will execute multiple times based on the test data but when if we executing scenario outline it should not execute from give Statement every time, it has to execute the Example Multiple times.
How to solve this issues.



@Workflow
Scenario Outline: Perform
Given I click on Maglink
When I Click AllMagLink & Select Exception on Advanced Filters
And I Send the Value After Reading Form ExcelSheet
And I Click on Search
And I Click on subregLink
And I Get The xxxx From xxxx Tab
Then I Click on <Tabs> and Validate it in AllTasks

Examples:
|Tabs |
|Apple |
|Mango |
| PineApple |









share|improve this question













When I am executing Scenario Outline it is executing multiple times from starting of the scenario outline, I know it will execute multiple times based on the test data but when if we executing scenario outline it should not execute from give Statement every time, it has to execute the Example Multiple times.
How to solve this issues.



@Workflow
Scenario Outline: Perform
Given I click on Maglink
When I Click AllMagLink & Select Exception on Advanced Filters
And I Send the Value After Reading Form ExcelSheet
And I Click on Search
And I Click on subregLink
And I Get The xxxx From xxxx Tab
Then I Click on <Tabs> and Validate it in AllTasks

Examples:
|Tabs |
|Apple |
|Mango |
| PineApple |






cucumber selenium-chromedriver cucumber-jvm cucumber-java cucumber-junit






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 20 '18 at 15:23









user5575586user5575586

54




54












  • Scenariooutline will repeat each step for each row of the examples table. That is what it does. There is no such existinh feature to repeat a step of a scenario. What u can try is use a datatable instead of examples. Then iterate the datatable in the stepdef method with necessary details.
    – Grasshopper
    Nov 21 '18 at 3:21


















  • Scenariooutline will repeat each step for each row of the examples table. That is what it does. There is no such existinh feature to repeat a step of a scenario. What u can try is use a datatable instead of examples. Then iterate the datatable in the stepdef method with necessary details.
    – Grasshopper
    Nov 21 '18 at 3:21
















Scenariooutline will repeat each step for each row of the examples table. That is what it does. There is no such existinh feature to repeat a step of a scenario. What u can try is use a datatable instead of examples. Then iterate the datatable in the stepdef method with necessary details.
– Grasshopper
Nov 21 '18 at 3:21




Scenariooutline will repeat each step for each row of the examples table. That is what it does. There is no such existinh feature to repeat a step of a scenario. What u can try is use a datatable instead of examples. Then iterate the datatable in the stepdef method with necessary details.
– Grasshopper
Nov 21 '18 at 3:21












1 Answer
1






active

oldest

votes


















0














A scenario outline is a way to run several scenarios from one written definition. For each example the scenario will be run from the beginning as a single scenario. Between each scenario (each example) everything is reset so that previous scenarios do not affect current ones.



This is how scenario outlines work, and have worked for the last 10 years. They work correctly and that's not going to change. You have just misunderstood how they work.



If you want to write a single scenario that does many different things, then you have to push the code that does this down into your step definitions, so you end up with steps like



When 'I do many different things' do
@results =
@results << do_first_thing
@results << do_second_thing
end

Then "I should see I've done different things" do
# examine @results
end


NOTE: code above is Ruby






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53396209%2fwhen-i-am-executing-scenario-outline-it-is-executing-multiple-times-from-given-s%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    A scenario outline is a way to run several scenarios from one written definition. For each example the scenario will be run from the beginning as a single scenario. Between each scenario (each example) everything is reset so that previous scenarios do not affect current ones.



    This is how scenario outlines work, and have worked for the last 10 years. They work correctly and that's not going to change. You have just misunderstood how they work.



    If you want to write a single scenario that does many different things, then you have to push the code that does this down into your step definitions, so you end up with steps like



    When 'I do many different things' do
    @results =
    @results << do_first_thing
    @results << do_second_thing
    end

    Then "I should see I've done different things" do
    # examine @results
    end


    NOTE: code above is Ruby






    share|improve this answer


























      0














      A scenario outline is a way to run several scenarios from one written definition. For each example the scenario will be run from the beginning as a single scenario. Between each scenario (each example) everything is reset so that previous scenarios do not affect current ones.



      This is how scenario outlines work, and have worked for the last 10 years. They work correctly and that's not going to change. You have just misunderstood how they work.



      If you want to write a single scenario that does many different things, then you have to push the code that does this down into your step definitions, so you end up with steps like



      When 'I do many different things' do
      @results =
      @results << do_first_thing
      @results << do_second_thing
      end

      Then "I should see I've done different things" do
      # examine @results
      end


      NOTE: code above is Ruby






      share|improve this answer
























        0












        0








        0






        A scenario outline is a way to run several scenarios from one written definition. For each example the scenario will be run from the beginning as a single scenario. Between each scenario (each example) everything is reset so that previous scenarios do not affect current ones.



        This is how scenario outlines work, and have worked for the last 10 years. They work correctly and that's not going to change. You have just misunderstood how they work.



        If you want to write a single scenario that does many different things, then you have to push the code that does this down into your step definitions, so you end up with steps like



        When 'I do many different things' do
        @results =
        @results << do_first_thing
        @results << do_second_thing
        end

        Then "I should see I've done different things" do
        # examine @results
        end


        NOTE: code above is Ruby






        share|improve this answer












        A scenario outline is a way to run several scenarios from one written definition. For each example the scenario will be run from the beginning as a single scenario. Between each scenario (each example) everything is reset so that previous scenarios do not affect current ones.



        This is how scenario outlines work, and have worked for the last 10 years. They work correctly and that's not going to change. You have just misunderstood how they work.



        If you want to write a single scenario that does many different things, then you have to push the code that does this down into your step definitions, so you end up with steps like



        When 'I do many different things' do
        @results =
        @results << do_first_thing
        @results << do_second_thing
        end

        Then "I should see I've done different things" do
        # examine @results
        end


        NOTE: code above is Ruby







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 26 '18 at 9:48









        diabolistdiabolist

        2,0291712




        2,0291712






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53396209%2fwhen-i-am-executing-scenario-outline-it-is-executing-multiple-times-from-given-s%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            If I really need a card on my start hand, how many mulligans make sense? [duplicate]

            Alcedinidae

            Can an atomic nucleus contain both particles and antiparticles? [duplicate]