How can i add an optional list parameter to my keyword at robotframework?Select option robotframeworkHow can we use “Set Variable if” with a keyword where Keyword is returning a variable RobotFrameworkHow to use User Keyword Arguments with default values in RobotFrameworkRobotframework: How to build proper keyword with embedded variable which defines number next parameters?RobotFramework Keyword variable not settingRobotFramework: Define a Python keyword in RobotFrameworkhow to list all keywords used by a robotframework test suiteHow to handle a named parameter and @keyword in robotframeworkHow to add additional output info from code to robotframework *.html reportRobotFramework - How to Return Value from Keyword and Stop?

How would you write do the dialogues of two characters talking in a chat room?

Can a continent naturally split into two distant parts within a week?

How did John Lennon tune his guitar

Is it okay to retroactively change things when running a published adventure?

Why do legislative committees exist?

Deep Learning based time series forecasting

Why is dry soil hydrophobic? Bad gardener paradox

How to fit a linear model in the Bayesian way in Mathematica?

Crab Nebula short story from 1960s or '70s

Behavior of the zero and negative/sign flags on classic instruction sets

Why linear regression uses "vertical" distance to the best-fit-line, instead of actual distance?

How are "soeben" and "eben" different from one another?

Ezek. 24:1-2, "Again in the ninth year, in the tenth month, in the tenth day of the month, ...." Which month was the tenth month?

Would letting a multiclass character rebuild their character to be single-classed be game-breaking?

What are some symbols representing peasants/oppressed persons fighting back?

What impact would a dragon the size of Asia have on the environment?

GPIO and Python - GPIO.output() not working

Does optical correction give a more aesthetic look to the SBI logo?

Why doesn't Anakin's lightsaber explode when it's chopped in half on Geonosis?

Are there any double stars that I can actually see orbit each other?

Cubic programming and beyond?

Remove intersect line for one circle using venndiagram2sets

Is killing off one of my queer characters homophobic?

What are the arguments for California’s nonpartisan blanket primaries other than giving Democrats more power?



How can i add an optional list parameter to my keyword at robotframework?


Select option robotframeworkHow can we use “Set Variable if” with a keyword where Keyword is returning a variable RobotFrameworkHow to use User Keyword Arguments with default values in RobotFrameworkRobotframework: How to build proper keyword with embedded variable which defines number next parameters?RobotFramework Keyword variable not settingRobotFramework: Define a Python keyword in RobotFrameworkhow to list all keywords used by a robotframework test suiteHow to handle a named parameter and @keyword in robotframeworkHow to add additional output info from code to robotframework *.html reportRobotFramework - How to Return Value from Keyword and Stop?






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








-1















I am trying to add optional dictionary and list to my keyword, how can assign their default values?










share|improve this question






















  • Can you explain what you've tried and what the error is that you're seeing?

    – A. Kootstra
    Mar 26 at 7:47











  • Are you writing this keyword in robot, in python, or some other language? It would help if you could provide a minimal reproducible example that shows us what you've tried.

    – Bryan Oakley
    Mar 26 at 13:05

















-1















I am trying to add optional dictionary and list to my keyword, how can assign their default values?










share|improve this question






















  • Can you explain what you've tried and what the error is that you're seeing?

    – A. Kootstra
    Mar 26 at 7:47











  • Are you writing this keyword in robot, in python, or some other language? It would help if you could provide a minimal reproducible example that shows us what you've tried.

    – Bryan Oakley
    Mar 26 at 13:05













-1












-1








-1








I am trying to add optional dictionary and list to my keyword, how can assign their default values?










share|improve this question














I am trying to add optional dictionary and list to my keyword, how can assign their default values?







robotframework






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 26 at 6:39









Alper OguzkanAlper Oguzkan

193 bronze badges




193 bronze badges












  • Can you explain what you've tried and what the error is that you're seeing?

    – A. Kootstra
    Mar 26 at 7:47











  • Are you writing this keyword in robot, in python, or some other language? It would help if you could provide a minimal reproducible example that shows us what you've tried.

    – Bryan Oakley
    Mar 26 at 13:05

















  • Can you explain what you've tried and what the error is that you're seeing?

    – A. Kootstra
    Mar 26 at 7:47











  • Are you writing this keyword in robot, in python, or some other language? It would help if you could provide a minimal reproducible example that shows us what you've tried.

    – Bryan Oakley
    Mar 26 at 13:05
















Can you explain what you've tried and what the error is that you're seeing?

– A. Kootstra
Mar 26 at 7:47





Can you explain what you've tried and what the error is that you're seeing?

– A. Kootstra
Mar 26 at 7:47













Are you writing this keyword in robot, in python, or some other language? It would help if you could provide a minimal reproducible example that shows us what you've tried.

– Bryan Oakley
Mar 26 at 13:05





Are you writing this keyword in robot, in python, or some other language? It would help if you could provide a minimal reproducible example that shows us what you've tried.

– Bryan Oakley
Mar 26 at 13:05












2 Answers
2






active

oldest

votes


















3














In the RF User Guide you can find examples of how you can add arguments with default values. In short, after the variable you have to add "=" and the value by default. Here is an example:



One Required And One With Default
[Arguments] $required $optional=default
[Documentation] This keyword takes 1-2 arguments
Log Required: $required
Log Optional: $optional





share|improve this answer






























    0














    While the other answer covers correctly keyword parameters with defeat values, your question is for a default list one.



    And this is not allowed by Robot Framework syntax (and in python, having a default value being a predefined list is a source of a lot of pain and hidden bugs :). So the solution for that is to have a parameter which default value is None (usually, really anything the caller would not pass would do), and check was it set in the call; if not - assign it to the default list, inside the keyword:



    My Keyword That Accepts Optional List
    [Arguments] $the_list=$None

    $the default value= Create List member0 the other one
    $the_list= Set Variable If $the_list is None $the default value # no argument passed when the keyword was called
    ... $the_list # an argument was passed, leave the variable as it was





    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%2f55351148%2fhow-can-i-add-an-optional-list-parameter-to-my-keyword-at-robotframework%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      In the RF User Guide you can find examples of how you can add arguments with default values. In short, after the variable you have to add "=" and the value by default. Here is an example:



      One Required And One With Default
      [Arguments] $required $optional=default
      [Documentation] This keyword takes 1-2 arguments
      Log Required: $required
      Log Optional: $optional





      share|improve this answer



























        3














        In the RF User Guide you can find examples of how you can add arguments with default values. In short, after the variable you have to add "=" and the value by default. Here is an example:



        One Required And One With Default
        [Arguments] $required $optional=default
        [Documentation] This keyword takes 1-2 arguments
        Log Required: $required
        Log Optional: $optional





        share|improve this answer

























          3












          3








          3







          In the RF User Guide you can find examples of how you can add arguments with default values. In short, after the variable you have to add "=" and the value by default. Here is an example:



          One Required And One With Default
          [Arguments] $required $optional=default
          [Documentation] This keyword takes 1-2 arguments
          Log Required: $required
          Log Optional: $optional





          share|improve this answer













          In the RF User Guide you can find examples of how you can add arguments with default values. In short, after the variable you have to add "=" and the value by default. Here is an example:



          One Required And One With Default
          [Arguments] $required $optional=default
          [Documentation] This keyword takes 1-2 arguments
          Log Required: $required
          Log Optional: $optional






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 26 at 7:50









          NomceNomce

          5901 gold badge4 silver badges16 bronze badges




          5901 gold badge4 silver badges16 bronze badges























              0














              While the other answer covers correctly keyword parameters with defeat values, your question is for a default list one.



              And this is not allowed by Robot Framework syntax (and in python, having a default value being a predefined list is a source of a lot of pain and hidden bugs :). So the solution for that is to have a parameter which default value is None (usually, really anything the caller would not pass would do), and check was it set in the call; if not - assign it to the default list, inside the keyword:



              My Keyword That Accepts Optional List
              [Arguments] $the_list=$None

              $the default value= Create List member0 the other one
              $the_list= Set Variable If $the_list is None $the default value # no argument passed when the keyword was called
              ... $the_list # an argument was passed, leave the variable as it was





              share|improve this answer



























                0














                While the other answer covers correctly keyword parameters with defeat values, your question is for a default list one.



                And this is not allowed by Robot Framework syntax (and in python, having a default value being a predefined list is a source of a lot of pain and hidden bugs :). So the solution for that is to have a parameter which default value is None (usually, really anything the caller would not pass would do), and check was it set in the call; if not - assign it to the default list, inside the keyword:



                My Keyword That Accepts Optional List
                [Arguments] $the_list=$None

                $the default value= Create List member0 the other one
                $the_list= Set Variable If $the_list is None $the default value # no argument passed when the keyword was called
                ... $the_list # an argument was passed, leave the variable as it was





                share|improve this answer

























                  0












                  0








                  0







                  While the other answer covers correctly keyword parameters with defeat values, your question is for a default list one.



                  And this is not allowed by Robot Framework syntax (and in python, having a default value being a predefined list is a source of a lot of pain and hidden bugs :). So the solution for that is to have a parameter which default value is None (usually, really anything the caller would not pass would do), and check was it set in the call; if not - assign it to the default list, inside the keyword:



                  My Keyword That Accepts Optional List
                  [Arguments] $the_list=$None

                  $the default value= Create List member0 the other one
                  $the_list= Set Variable If $the_list is None $the default value # no argument passed when the keyword was called
                  ... $the_list # an argument was passed, leave the variable as it was





                  share|improve this answer













                  While the other answer covers correctly keyword parameters with defeat values, your question is for a default list one.



                  And this is not allowed by Robot Framework syntax (and in python, having a default value being a predefined list is a source of a lot of pain and hidden bugs :). So the solution for that is to have a parameter which default value is None (usually, really anything the caller would not pass would do), and check was it set in the call; if not - assign it to the default list, inside the keyword:



                  My Keyword That Accepts Optional List
                  [Arguments] $the_list=$None

                  $the default value= Create List member0 the other one
                  $the_list= Set Variable If $the_list is None $the default value # no argument passed when the keyword was called
                  ... $the_list # an argument was passed, leave the variable as it was






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 30 at 5:32









                  Todor MinakovTodor Minakov

                  8,9261 gold badge29 silver badges39 bronze badges




                  8,9261 gold badge29 silver badges39 bronze badges



























                      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%2f55351148%2fhow-can-i-add-an-optional-list-parameter-to-my-keyword-at-robotframework%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