Skip to main content
Version: 23.5.0

ElementHandle.tap() 方法

¥ElementHandle.tap() method

如果需要,此方法将元素滚动到视图中,然后使用 Touchscreen.tap() 点击元素的中心。如果元素与 DOM 分离,该方法会抛出错误。

¥This method scrolls element into view if needed, and then uses Touchscreen.tap() to tap in the center of the element. If the element is detached from DOM, the method throws an error.

签名

¥Signature

class ElementHandle {
tap(this: ElementHandle<Element>): Promise<void>;
}

参数

¥Parameters

范围

类型

描述

this

ElementHandle<元素>

Returns:

Promise<void>