什么是帆2中的动作2的好例子和最佳实践

时间:2018-06-05 07:22:12

标签: asynchronous error-handling callback promise sails.js

我很喜欢帆。 这是我的代码应用操作2

/**
 * Select a frame by its (zero-based) index. Selecting a frame by index is equivalent to the
 * JS expression window.frames[index] where "window" is the DOM window represented by the
 * current context. Once the frame has been selected, all subsequent calls on the WebDriver
 * interface are made to that frame.
 *
 * @param index (zero-based) index
 * @return This driver focused on the given frame
 * @throws NoSuchFrameException If the frame cannot be found
 */
WebDriver frame(int index);

/**
 * Select a frame by its name or ID. Frames located by matching name attributes are always given
 * precedence over those matched by ID.
 *
 * @param nameOrId the name of the frame window, the id of the <frame> or <iframe>
 *        element, or the (zero-based) index
 * @return This driver focused on the given frame
 * @throws NoSuchFrameException If the frame cannot be found
 */
WebDriver frame(String nameOrId);

/**
 * Select a frame using its previously located {@link WebElement}.
 *
 * @param frameElement The frame element to switch to.
 * @return This driver focused on the given frame.
 * @throws NoSuchFrameException If the given element is neither an IFRAME nor a FRAME element.
 * @throws StaleElementReferenceException If the WebElement has gone stale.
 * @see WebDriver#findElement(By)
 */
WebDriver frame(WebElement frameElement);

}

可以控制任何错误吗?如果没有,请建议我在帆中采取行动的良好格式的最佳做法。

0 个答案:

没有答案