You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@gaurav294
just modify this file robot\running\steprunner.py, near line 33
edit this function to
defrun_steps(self, steps):
errors= []
cursor=0# the index to executekeywords= [ str(step).lower() forstepinsteps ]
whilecursor<len(steps):
try:
step=steps[cursor]
ifstr(step).lower() =="reloop":
assert"exit for loop if"inkeywordsor"exit for loop"inkeywords,\
"both for loop and exit condition are needed"cursor=0continuecursor+=1self.run_step(step)
exceptExecutionPassedasexception:
......
Then the RELOOP "keyword" can jump to the first line immediately but it won't carry the next element of the range.
So we can use it like this
*** Test Cases ***Example_Case${j} set variable ${0}
:for ${n} in range ${1}
\ ${j} set variable ${${j}+1}
\ log many ${j}
\ exit for loop if ${j}==${1000}
\ reloop
log many done ${j}
This is interesting but not something that will be directly added to RF. Native WHILE loop support may be added after we got IF/ELSE and TRY/EXCEPT done.
@gaurav294
just modify this file robot\running\steprunner.py, near line 33
edit this function to
Then the RELOOP "keyword" can jump to the first line immediately but it won't carry the next element of the range.
So we can use it like this
this means
but a bit ugly
any other good modifies?
#2721
The text was updated successfully, but these errors were encountered: