How can I run this loops in robot framework?












0















How can I run IF statement from bottom in romot framework?



(while i!=500:/ i = i + 1)


How can I execute python code as I tried to do on the bottom of my code?



*** Settings ***
Library SeleniumLibrary

*** Variables ***
${Browser} Chrome
${URL} https://safeweb.aec.cz/level12.php
*** Test Cases ***
MYbot prihlas_kopiruj_stlac
Open Browser ${URL} ${Browser}
Input Text name:login Trollingcat
Input Text name:password Halo12345
Click Button submit
go to ${URL}

while i!=500:
${get_text}= Get Text //*[@id="cid"]
Input Text name:captcha ${get_text}
Click Button ok
i = i + 1


I tried to do it this way but it's complaining




FOR loop contains no keywords




I just never used this way of coding loops (and I'm also supposed that this module is not using classical loops like in others programming languages).



: FOR  ${i}  IN RANGE  1  500
${get_text}= Get Text //*[@id="cid"]
Input Text name:captcha ${get_text}
Click Button ok









share|improve this question





























    0















    How can I run IF statement from bottom in romot framework?



    (while i!=500:/ i = i + 1)


    How can I execute python code as I tried to do on the bottom of my code?



    *** Settings ***
    Library SeleniumLibrary

    *** Variables ***
    ${Browser} Chrome
    ${URL} https://safeweb.aec.cz/level12.php
    *** Test Cases ***
    MYbot prihlas_kopiruj_stlac
    Open Browser ${URL} ${Browser}
    Input Text name:login Trollingcat
    Input Text name:password Halo12345
    Click Button submit
    go to ${URL}

    while i!=500:
    ${get_text}= Get Text //*[@id="cid"]
    Input Text name:captcha ${get_text}
    Click Button ok
    i = i + 1


    I tried to do it this way but it's complaining




    FOR loop contains no keywords




    I just never used this way of coding loops (and I'm also supposed that this module is not using classical loops like in others programming languages).



    : FOR  ${i}  IN RANGE  1  500
    ${get_text}= Get Text //*[@id="cid"]
    Input Text name:captcha ${get_text}
    Click Button ok









    share|improve this question



























      0












      0








      0








      How can I run IF statement from bottom in romot framework?



      (while i!=500:/ i = i + 1)


      How can I execute python code as I tried to do on the bottom of my code?



      *** Settings ***
      Library SeleniumLibrary

      *** Variables ***
      ${Browser} Chrome
      ${URL} https://safeweb.aec.cz/level12.php
      *** Test Cases ***
      MYbot prihlas_kopiruj_stlac
      Open Browser ${URL} ${Browser}
      Input Text name:login Trollingcat
      Input Text name:password Halo12345
      Click Button submit
      go to ${URL}

      while i!=500:
      ${get_text}= Get Text //*[@id="cid"]
      Input Text name:captcha ${get_text}
      Click Button ok
      i = i + 1


      I tried to do it this way but it's complaining




      FOR loop contains no keywords




      I just never used this way of coding loops (and I'm also supposed that this module is not using classical loops like in others programming languages).



      : FOR  ${i}  IN RANGE  1  500
      ${get_text}= Get Text //*[@id="cid"]
      Input Text name:captcha ${get_text}
      Click Button ok









      share|improve this question
















      How can I run IF statement from bottom in romot framework?



      (while i!=500:/ i = i + 1)


      How can I execute python code as I tried to do on the bottom of my code?



      *** Settings ***
      Library SeleniumLibrary

      *** Variables ***
      ${Browser} Chrome
      ${URL} https://safeweb.aec.cz/level12.php
      *** Test Cases ***
      MYbot prihlas_kopiruj_stlac
      Open Browser ${URL} ${Browser}
      Input Text name:login Trollingcat
      Input Text name:password Halo12345
      Click Button submit
      go to ${URL}

      while i!=500:
      ${get_text}= Get Text //*[@id="cid"]
      Input Text name:captcha ${get_text}
      Click Button ok
      i = i + 1


      I tried to do it this way but it's complaining




      FOR loop contains no keywords




      I just never used this way of coding loops (and I'm also supposed that this module is not using classical loops like in others programming languages).



      : FOR  ${i}  IN RANGE  1  500
      ${get_text}= Get Text //*[@id="cid"]
      Input Text name:captcha ${get_text}
      Click Button ok






      python for-loop if-statement while-loop robotframework






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 11 at 18:42







      Branislav Hraško

















      asked Jan 1 at 17:36









      Branislav HraškoBranislav Hraško

      294




      294
























          2 Answers
          2






          active

          oldest

          votes


















          3














          I just found out solution



          : FOR  ${i}  IN RANGE  1  500
          ${get_text}= Get Text //*[@id="cid"]
          Input Text name:captcha ${get_text}
          Click Button ok


          this way it's working






          share|improve this answer

































            1














            I do not know which version of Robot Framework you use, but I suggest upgrading to 3.1 as they have cleaned up the for loop syntax there a little bit.



            While the one you have mentioned in your answer is still supported, a much nicer syntax has been added:



            FOR  ${i}  IN RANGE  1  500
            ${get_text}= Get Text //*[@id="cid"]
            Input Text name:captcha ${get_text}
            Click Button ok
            END


            You do not need the : and all those , and the end of the loop body is marked explicitly as well.






            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%2f53997544%2fhow-can-i-run-this-loops-in-robot-framework%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














              I just found out solution



              : FOR  ${i}  IN RANGE  1  500
              ${get_text}= Get Text //*[@id="cid"]
              Input Text name:captcha ${get_text}
              Click Button ok


              this way it's working






              share|improve this answer






























                3














                I just found out solution



                : FOR  ${i}  IN RANGE  1  500
                ${get_text}= Get Text //*[@id="cid"]
                Input Text name:captcha ${get_text}
                Click Button ok


                this way it's working






                share|improve this answer




























                  3












                  3








                  3







                  I just found out solution



                  : FOR  ${i}  IN RANGE  1  500
                  ${get_text}= Get Text //*[@id="cid"]
                  Input Text name:captcha ${get_text}
                  Click Button ok


                  this way it's working






                  share|improve this answer















                  I just found out solution



                  : FOR  ${i}  IN RANGE  1  500
                  ${get_text}= Get Text //*[@id="cid"]
                  Input Text name:captcha ${get_text}
                  Click Button ok


                  this way it's working







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 1 at 19:45









                  James Z

                  11.2k71935




                  11.2k71935










                  answered Jan 1 at 18:12









                  Branislav HraškoBranislav Hraško

                  294




                  294

























                      1














                      I do not know which version of Robot Framework you use, but I suggest upgrading to 3.1 as they have cleaned up the for loop syntax there a little bit.



                      While the one you have mentioned in your answer is still supported, a much nicer syntax has been added:



                      FOR  ${i}  IN RANGE  1  500
                      ${get_text}= Get Text //*[@id="cid"]
                      Input Text name:captcha ${get_text}
                      Click Button ok
                      END


                      You do not need the : and all those , and the end of the loop body is marked explicitly as well.






                      share|improve this answer




























                        1














                        I do not know which version of Robot Framework you use, but I suggest upgrading to 3.1 as they have cleaned up the for loop syntax there a little bit.



                        While the one you have mentioned in your answer is still supported, a much nicer syntax has been added:



                        FOR  ${i}  IN RANGE  1  500
                        ${get_text}= Get Text //*[@id="cid"]
                        Input Text name:captcha ${get_text}
                        Click Button ok
                        END


                        You do not need the : and all those , and the end of the loop body is marked explicitly as well.






                        share|improve this answer


























                          1












                          1








                          1







                          I do not know which version of Robot Framework you use, but I suggest upgrading to 3.1 as they have cleaned up the for loop syntax there a little bit.



                          While the one you have mentioned in your answer is still supported, a much nicer syntax has been added:



                          FOR  ${i}  IN RANGE  1  500
                          ${get_text}= Get Text //*[@id="cid"]
                          Input Text name:captcha ${get_text}
                          Click Button ok
                          END


                          You do not need the : and all those , and the end of the loop body is marked explicitly as well.






                          share|improve this answer













                          I do not know which version of Robot Framework you use, but I suggest upgrading to 3.1 as they have cleaned up the for loop syntax there a little bit.



                          While the one you have mentioned in your answer is still supported, a much nicer syntax has been added:



                          FOR  ${i}  IN RANGE  1  500
                          ${get_text}= Get Text //*[@id="cid"]
                          Input Text name:captcha ${get_text}
                          Click Button ok
                          END


                          You do not need the : and all those , and the end of the loop body is marked explicitly as well.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jan 1 at 21:27









                          Bence KaulicsBence Kaulics

                          3,13372140




                          3,13372140






























                              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%2f53997544%2fhow-can-i-run-this-loops-in-robot-framework%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

                              Monofisismo

                              Angular Downloading a file using contenturl with Basic Authentication

                              Olmecas