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
范围 🌐 Parameter | 类型 🌐 Type | 描述 🌐 Description |
|---|---|---|
this | ElementHandle<Element> |
返回:
Locator<Element>