2023-07-20 07:36:56 +00:00
|
|
|
---
|
|
|
|
sidebar_label: Locator.race
|
|
|
|
---
|
|
|
|
|
|
|
|
# Locator.race() method
|
|
|
|
|
|
|
|
Creates a race between multiple locators but ensures that only a single one acts.
|
|
|
|
|
|
|
|
#### Signature:
|
|
|
|
|
|
|
|
```typescript
|
|
|
|
class Locator {
|
2023-08-02 12:50:46 +00:00
|
|
|
static race<Locators extends readonly unknown[] | []>(
|
2023-07-20 07:36:56 +00:00
|
|
|
locators: Locators
|
2023-08-02 12:50:46 +00:00
|
|
|
): Locator<AwaitedLocator<Locators[number]>>;
|
2023-07-20 07:36:56 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --------- | -------- | ----------- |
|
|
|
|
| locators | Locators | |
|
|
|
|
|
|
|
|
**Returns:**
|
|
|
|
|
2023-08-02 12:50:46 +00:00
|
|
|
[Locator](./puppeteer.locator.md)<[AwaitedLocator](./puppeteer.awaitedlocator.md)<Locators\[number\]>>
|