Skip to main content
Version: 24.20.0

ElementHandle.asLocator() 方法

¥ElementHandle.asLocator() method

基于 ElementHandle 创建一个定位器。如果元素句柄已过期,则不允许刷新,但允许重用其他定位器先决条件。

¥Creates a locator based on an ElementHandle. This would not allow refreshing the element handle if it is stale but it allows re-using other locator pre-conditions.

签名

¥Signature

class ElementHandle {
asLocator(this: ElementHandle<Element>): Locator<Element>;
}

参数

¥Parameters

范围

类型

描述

this

ElementHandle<元素>

Returns:

Locator<Element>