Skip to main content
Version: 22.14.0

Page.locator() 方法

¥Page.locator() method

为提供的函数创建一个定位器。有关详细信息和支持的操作,请参阅 定位器

¥Creates a locator for the provided function. See Locator for details and supported actions.

签名:

¥Signature:

class Page {
locator<Ret>(func: () => Awaitable<Ret>): Locator<Ret>;
}

参数

¥Parameters

范围

类型

描述

func

() => 等待的<Ret>

Returns:

Locator<Ret>