Skip to main content
Version: 24.38.0

Locator.setTimeout() 方法

🌐 Locator.setTimeout() method

通过克隆当前定位器并设置定位器操作的总超时来创建一个新的定位器实例。

🌐 Creates a new locator instance by cloning the current locator and setting the total timeout for the locator actions.

传递 0 来禁用超时。

🌐 Pass 0 to disable timeout.

语法

🌐 Signature

class Locator {
setTimeout(timeout: number): Locator<T>;
}

参数

🌐 Parameters

范围

🌐 Parameter

类型

🌐 Type

描述

🌐 Description

timeout

number

返回:

Locator<T>

默认值:

🌐 Default value:

Page.getDefaultTimeout()