Data Driven testing with cucumber protractorHow to implement different data for cucumber scenarios based on environmentError when running Cucumber Junit test :Intializationerrorcucumber.runtime.CucumberException: No features found at []Java Cucumber: How to get string parameter values from all the steps in a single scenarioData driven testing in Cucumber using Excel sheetsFetching data from json file in protractorCucumber Java error java.lang.AbstractMethodErrorExceptions while running Cucumber TestsProtractor Data Driven test with Cucumbercucumber and protractor html and json

How can you evade tax by getting employment income just in equity, then using this equity as collateral to take out loan?

Why doesn't the "ch" pronunciation rule occur for words such as "durch" and "manchmal"?

Buffering in WGS 84 / Pseudo-Mercator 3857 using QGIS?

Word or idiom defining something barely functional

Why does Intel's Haswell chip allow FP multiplication to be twice as fast as addition?

Why is there a need to prevent a racist, sexist, or otherwise bigoted vendor from discriminating who they sell to?

What are these two charactes marked red

Unique combinations of a list of tuples

Ex-contractor published company source code and secrets online

Performance of a branch and bound algorithm VS branch-cut-heuristics

In Pokémon Go, why does one of my Pikachu have an option to evolve, but another one doesn't?

How to mark beverage cans in a cooler for a blind person?

How can I tell if a flight itinerary is fake?

Was this a rapid SCHEDULED disassembly? How was it done?

Why are the inside diameters of some pipe larger than the stated size?

First amendment and employment: Can an employer terminate you for speech?

Am I overreacting to my team leader's unethical requests?

In reversi, can you overwrite two chips in one move?

Author changing name

Generator for parity?

How to vertically align the three columns of my table top, top, middle

Is refreshing multiple times a test case for web applications?

Best way to divide CPU along all sql instances on 1 server

Write an interpreter for *



Data Driven testing with cucumber protractor


How to implement different data for cucumber scenarios based on environmentError when running Cucumber Junit test :Intializationerrorcucumber.runtime.CucumberException: No features found at []Java Cucumber: How to get string parameter values from all the steps in a single scenarioData driven testing in Cucumber using Excel sheetsFetching data from json file in protractorCucumber Java error java.lang.AbstractMethodErrorExceptions while running Cucumber TestsProtractor Data Driven test with Cucumbercucumber and protractor html and json






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Lets say I have a scenario in my demo.feature file



Scenario Outline: Gather and load all submenus
Given I will login using <username> and <password>
When I will click all links
Examples :
| username | password |
| user1 | pass1 |
| use2 | pass2 |


lets say i have a file called users.json



How can i get those usernames and passwords from that external file to my demo.feature ?
Can I catch the file by passing parameters to my npm script like below ?
npm run cucumber -- --params.environment.file=usernames.json










share|improve this question






























    0















    Lets say I have a scenario in my demo.feature file



    Scenario Outline: Gather and load all submenus
    Given I will login using <username> and <password>
    When I will click all links
    Examples :
    | username | password |
    | user1 | pass1 |
    | use2 | pass2 |


    lets say i have a file called users.json



    How can i get those usernames and passwords from that external file to my demo.feature ?
    Can I catch the file by passing parameters to my npm script like below ?
    npm run cucumber -- --params.environment.file=usernames.json










    share|improve this question


























      0












      0








      0








      Lets say I have a scenario in my demo.feature file



      Scenario Outline: Gather and load all submenus
      Given I will login using <username> and <password>
      When I will click all links
      Examples :
      | username | password |
      | user1 | pass1 |
      | use2 | pass2 |


      lets say i have a file called users.json



      How can i get those usernames and passwords from that external file to my demo.feature ?
      Can I catch the file by passing parameters to my npm script like below ?
      npm run cucumber -- --params.environment.file=usernames.json










      share|improve this question














      Lets say I have a scenario in my demo.feature file



      Scenario Outline: Gather and load all submenus
      Given I will login using <username> and <password>
      When I will click all links
      Examples :
      | username | password |
      | user1 | pass1 |
      | use2 | pass2 |


      lets say i have a file called users.json



      How can i get those usernames and passwords from that external file to my demo.feature ?
      Can I catch the file by passing parameters to my npm script like below ?
      npm run cucumber -- --params.environment.file=usernames.json







      protractor cucumber gherkin cucumberjs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 27 at 7:35









      AMendisAMendis

      2711 gold badge3 silver badges6 bronze badges




      2711 gold badge3 silver badges6 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0














          I recommend having the login step access that json file within the step definition. Just make sure not to check it into the repo and instead always expect it to be in a location but only locally and not in the repository.



          Doing the above is useful for a couple of reasons:
          - An engineer running your tests does not need to know that a param must be passed in from the command line
          - The code is self-descriptive in that step as to how it logs in
          - You can add better error handling
          - You can use multiple user files if needs be by having hooks define paths etc based on tags






          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%2f55371963%2fdata-driven-testing-with-cucumber-protractor%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














            I recommend having the login step access that json file within the step definition. Just make sure not to check it into the repo and instead always expect it to be in a location but only locally and not in the repository.



            Doing the above is useful for a couple of reasons:
            - An engineer running your tests does not need to know that a param must be passed in from the command line
            - The code is self-descriptive in that step as to how it logs in
            - You can add better error handling
            - You can use multiple user files if needs be by having hooks define paths etc based on tags






            share|improve this answer





























              0














              I recommend having the login step access that json file within the step definition. Just make sure not to check it into the repo and instead always expect it to be in a location but only locally and not in the repository.



              Doing the above is useful for a couple of reasons:
              - An engineer running your tests does not need to know that a param must be passed in from the command line
              - The code is self-descriptive in that step as to how it logs in
              - You can add better error handling
              - You can use multiple user files if needs be by having hooks define paths etc based on tags






              share|improve this answer



























                0












                0








                0







                I recommend having the login step access that json file within the step definition. Just make sure not to check it into the repo and instead always expect it to be in a location but only locally and not in the repository.



                Doing the above is useful for a couple of reasons:
                - An engineer running your tests does not need to know that a param must be passed in from the command line
                - The code is self-descriptive in that step as to how it logs in
                - You can add better error handling
                - You can use multiple user files if needs be by having hooks define paths etc based on tags






                share|improve this answer













                I recommend having the login step access that json file within the step definition. Just make sure not to check it into the repo and instead always expect it to be in a location but only locally and not in the repository.



                Doing the above is useful for a couple of reasons:
                - An engineer running your tests does not need to know that a param must be passed in from the command line
                - The code is self-descriptive in that step as to how it logs in
                - You can add better error handling
                - You can use multiple user files if needs be by having hooks define paths etc based on tags







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 27 at 16:58









                Raymond KellyRaymond Kelly

                4173 silver badges15 bronze badges




                4173 silver badges15 bronze badges





















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    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.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55371963%2fdata-driven-testing-with-cucumber-protractor%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

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript