throw new SeleniumException(e);
}
}
// command supported by WebDriverCommandProcessor
SubCommandMap subCommandMap = context.getSubCommandMap();
ISubCommand<?> subCommand = subCommandMap.get(realName);
if (subCommand != null)
return new BuiltInCommand(index, name, args, subCommand, andWait);
// FIXME #32 workaround alert command handling.
if (realName.matches("(?i)(?:assert|verify|waitFor)(?:Alert|Confirmation|Prompt)(?:(?:Not)?Present)?")) {
StringBuilder echo = new StringBuilder(name);
for (String arg : args)
echo.append(" ").append(arg);
return new Echo(index, name, echo.toString());
}
// See: http://selenium.googlecode.com/svn/trunk/ide/main/src/content/selenium-core/reference.html
// Assertion or Accessor
Matcher matcher = COMMAND_PATTERN.matcher(name);
if (!matcher.matches())
throw new SeleniumException("No such command: " + name);
String assertion = matcher.group(ASSERTION);
String target = matcher.group(TARGET);
if (target == null)
target = "Expression";
if (matcher.group(PRESENT) != null)
target += "Present";
boolean isBoolean = false;
String getter = "get" + target;
ISubCommand<?> getterSubCommand = subCommandMap.get(getter);
if (getterSubCommand == null) {
getter = "is" + target;
getterSubCommand = subCommandMap.get(getter);
if (getterSubCommand == null)
throw new SeleniumException("No such command: " + name);
isBoolean = true;
}
if (assertion != null) {