# RandomNumber

> Generates a random integer with a given length.

Generates a random integer with a given length.

## Definition

**Namespace:** UiPath.Testing.API

**Assembly:** UiPath.Testing.Activities.Api (in UiPath.Testing.Activities.Api.dll)

## Overloads

|  |  |
| --- | --- |
| `RandomNumber()` | Generates a random integer. |
| `RandomNumber(Int64, Int64)` | Generates a random integer, considering a minimum and maximum value. |
| `RandomNumber(Int64, Int64, Int32)` | Generates a random integer, considering a minimum and maximum value, as well as a number of decimals. |

## `RandomNumber()`

Generates a random integer.

```
decimal RandomNumber()
```

## `RandomNumber(Int64, Int64)`

Generates a random integer, considering a minimum and maximum value.

```
decimal RandomNumber(
    long min,
    long max
)
```

`min` [Int64](https://learn.microsoft.com/dotnet/api/system.int64) : The minimum value (default long.MinValue).

`max` [Int64](https://learn.microsoft.com/dotnet/api/system.int64) : The maximum value (default long.MaxValue).

## `RandomNumber(Int64, Int64, Int32)`

Generates a random integer, considering a minimum and maximum value, as well as a number of decimals.

```
decimal RandomNumber(
    long min,
    long max,
    int decimals
)
```

`min` [Int64](https://learn.microsoft.com/dotnet/api/system.int64) : The minimum value (default long.MinValue).

`max` [Int64](https://learn.microsoft.com/dotnet/api/system.int64) : The maximum value (default long.MaxValue).

`decimals` [Int32](https://learn.microsoft.com/dotnet/api/system.int32) : The number of decimals (default 0).

## Return value

[Decimal](https://learn.microsoft.com/dotnet/api/system.decimal)

Generated random number.
