Skip to main content
Version: 24.7.2

Locator.click()方法

¥Locator.click() method

单击定位到的元素。

¥Clicks the located element.

签名

¥Signature

class Locator {
click<ElementType extends Element>(
this: Locator<ElementType>,
options?: Readonly<LocatorClickOptions>,
): Promise<void>;
}

参数

¥Parameters

范围

类型

描述

this

定位器<元素类型>

options

只读<LocatorClickOptions>

(可选的)

Returns:

Promise<void>