Locator.setWaitForEnabled() 方法
🌐 Locator.setWaitForEnabled() method
通过克隆当前定位器并指定在执行操作前是否等待输入元素可用来创建一个新的定位器实例。适用于 click 和 fill 操作。
🌐 Creates a new locator instance by cloning the current locator and specifying whether to wait for input elements to become enabled before the action. Applicable to click and fill actions.
语法
🌐 Signature
class Locator {
setWaitForEnabled<NodeType extends Node>(
this: Locator<NodeType>,
value: boolean,
): Locator<NodeType>;
}
参数
🌐 Parameters
范围 🌐 Parameter | 类型 🌐 Type | 描述 🌐 Description |
|---|---|---|
this | Locator<NodeType> | |
value | boolean |
返回:
Locator<NodeType>
默认值:
🌐 Default value:
true