Exit from a loop if condition meets. [message #1791997] |
Mon, 09 July 2018 13:19  |
Eclipse User |
|
|
|
Hello,
I am trying to solve one of my rcptt execution problem. I want to wait until an element is loaded in my windows actually.
As i don't found any predefined api for doing this, i am trying to do this by using a loop. But i can not break from a loop if my condition meets. what i am doing is:
proc "wait-until-icon-loaded" [val iconName] {
loop [val count 1] [val n 5] {
if [$count | lt $n] {
try{
let [val text [get-button "Configure" | get-property "getToolTipText()" -raw]] {
if [$text | contains $iconName] {
recur [$count | plus 100] [$n]
}
}
} -catch {
show-alert "inside catch"
}
recur [$count | plus 1] [$n]
} -else {
show-alert "Finish"
}
}
}
But it can not break from loop if the execution meets its condition. What is the way in rcptt to break from a loop if condition meets or how i can wait until an element is loaded.
I want to do this because rcptt default wait time is not working in jenkins actually. It loads another window before finishing task in the previous one.
Thanks
|
|
|
Re: Exit from a loop if condition meets. [message #1792790 is a reply to message #1791997] |
Tue, 24 July 2018 07:03  |
Eclipse User |
|
|
|
Hi,
you should be able break the loop by not calling recur in case of match.
In your example you seem to recur in any way.
It might be you omitted it for the sake of the example, but if you want to wait in case of a nonmatch you can use the "wait" statement.
Best regards
Markus
|
|
|
Powered by
FUDForum. Page generated in 0.02872 seconds