sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #17283
[Question #225917]: For loop not breaking in java
New question #225917 on Sikuli:
https://answers.launchpad.net/sikuli/+question/225917
I am trying to delete rows in a queue via an iOS app. I press edit and the trash icon appear, and then I have sikuli select those icons to remove. Seems pretty straight forward and sikuli is really good at doing that . The trick in my case is that the list is dynamic and I never know how many rows will be visible in that queue so I created a For loop in java.
The loop does not seem to be breaking, Here is my code:
@Test
public void testDeleteTrashIcon() throws Exception {
for (int i = 0; i < 10; i++) {
s.wait("imgs/TrashIcon.png", 10);
s.click("imgs/TrashIcon.png", 0);
if (s.exists("imgs/ConfirmDeletionOfTrashIcons.png", 0) != null) {
break;
}
}
}
So here is the scenario in this one instance:
-there is a 2 rows displaying trash icon
-the loop I have set can delete up to 10
- the method above does not recognize the IF statement in the loop and gives me "FindFailed: can not find imgs/TrashIcon.png
can someone tell me where I have written this incorrectly? or another way to have sikuli loop until another image appears using java?
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.