int index = Integer.parseInt(locator.substring("index=".length()));
lastFrame.put(driver.getWindowHandle(), locator);
driver.switchTo().frame(index);
return;
} catch (NumberFormatException e) {
throw new SeleniumException(e.getMessage(), e);
} catch (NoSuchFrameException e) {
throw new SeleniumException(e.getMessage(), e);
}
}
if (locator.startsWith("id=")) {
locator = locator.substring("id=".length());
} else if (locator.startsWith("name=")) {
locator = locator.substring("name=".length());
}
try {
lastFrame.put(driver.getWindowHandle(), locator);
driver.switchTo().frame(locator);
} catch (NoSuchFrameException e) {
throw new SeleniumException(e.getMessage(), e);
}
}