private static void parseUntilConditions(GalenPageActionWait wait, String[] args) { if (args[2].equals("until")) { if (args.length > 3) { List<GalenPageActionWait.Until> untilElements = new LinkedList<GalenPageActionWait.Until>(); UntilType currentType = null; for (int i = 3; i < args.length; i++) { UntilType type = UntilType.parseNonStrict(args[i]); if (type != null) { currentType = type; } else { if (currentType == null) { throw new SyntaxException( "You have to specify one of the following checks: visible, hidden, exist, gone"); } untilElements.add(new GalenPageActionWait.Until(currentType, Locator.parse(args[i]))); } } wait.setUntilElements(untilElements); } else throw new SyntaxException("You have to provide locators"); } else throw new SyntaxException(String.format("Expected \"until\" but got \"%s\"", args[2])); }