# ObjectRepositoryTarget

> This is a UI element identified as an `ObjectRepositoryTarget`. In
comparison to the [IElementDescriptor](https://docs.uipath.com/activities/other/latest/ui-automation/ielementdescriptor), this selector allows you to use `Strings` to access Object Repository
elements. You can also access any descriptors, even if their names are duplicate in the
repository, because the `ObjectRepositoryTarget` class allows you to
specify the parents of the `String` descriptors that you're trying to
use.

This is a UI element identified as an `ObjectRepositoryTarget`. In
comparison to the [IElementDescriptor](https://docs.uipath.com/activities/other/latest/ui-automation/ielementdescriptor), this selector allows you to use `Strings` to access Object Repository
elements. You can also access any descriptors, even if their names are duplicate in the
repository, because the `ObjectRepositoryTarget` class allows you to
specify the parents of the `String` descriptors that you're trying to
use.

To use `ObjectRepositoryTarget` selectors, you must first create them,
using the `ObjectRepositoryTarget` class, along with its constructors:
`ObjectRepositoryTarget(String, String, String, String)`, and
`ObjectRepositoryTarget(String[], String, String, String)`

## Definition

**Namespace**: UiPath.MobileAutomation.API.Models

**Assembly**: UiPath.MobileAutomation.API (in UiPath.MobileAutomation.API.dll)

## Syntax

```
public class ObjectRepositoryTarget
```

The `ObjectRepositoryTarget` type exposes the following members:

## ObjectRepositoryTarget constructors

These constructors initialize a new instance of the
`ObjectRepositoryTarget` class.

### Overloads

| Overload | Description |
| --- | --- |
| `ObjectRepositoryTarget(string, string, string, string)` | Initializes a new instance of the `ObjectRepositoryTarget` class, enabling you to access up to the 4th level of object repository descriptors. When specifying the `elementPath` parameter, you should arrange parent-child relationships in a string format like "parentOfparent///parent///child", which allows traversal up to the 4th level. |
| `ObjectRepositoryTarget(string[], string, string, string)` | Initializes a new instance of the `ObjectRepositoryTarget` class and enables you to access up to the 4th level of object repository descriptors, by taking an array of strings. When specifying the `elementPath` parameter, the parent-child relationship is represented like ["parentOfParent", "parent", "child"], offering an alternative way to access the hierarchical descriptors. |

### `ObjectRepositoryTarget(string, string, string, string)`

Initializes a new instance of the
`ObjectRepositoryTarget` class, enabling you to access up to the 4th
level of object repository descriptors. When specifying the `elementPath`
parameter, you should arrange parent-child relationships in a string format like
"parentOfparent///parent///child", which allows traversal up to the 4th
level.

```
public ObjectRepositoryTarget(
    string elementPath,
    string appName = "***",
    string appVersion = "***",
    string screenName = "***"
)
```

`elementPath` [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0)
:   The hierarchical path leading up to the specific element descriptor you're
    aiming to automate. It provides a way to trace the lineage from the highest
    level parent down to the target child element within the object repository.
    This is useful in scenarios where you have nested elements or a deep
    hierarchy within your Object Repository application.
:   This parameter takes the form of a string where parent-child relationships
    are separated by `///`, such as
    "parentOfparent///parent///child".

`appName` [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0) (Optional)
:   The name of the Object Repository application where you want to access the
    desired UI element.

`appVersion` [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0) (Optional)
:   The version of the Object Repository application from where you want to
    access the desired UI element.

`screenName` [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0) (Optional)
:   The name of the Object Repository screen from where you want to access the
    desired UI element.

### `ObjectRepositoryTarget(string[], string, string, string)`

Initializes a new instance of the
`ObjectRepositoryTarget` class and enables you to access up to the
4th level of object repository descriptors, by taking an array of strings. When
specifying the `elementPath` parameter, the parent-child relationship is
represented like ["parentOfParent", "parent", "child"], offering an alternative way to
access the hierarchical
descriptors.

```
public ObjectRepositoryTarget(
    string[] elementPath,
    string appName = "***",
    string appVersion = "***",
    string screenName = "***"
)
```

`elementPath` [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0)[]
:   The hierarchical path leading up to the specific element descriptor you're
    aiming to automate. It provides a way to trace the lineage from the highest
    level parent down to the target child element within the object repository.
    This is useful in scenarios where you have nested elements or a deep
    hierarchy within your Object Repository application.
:   This parameter takes the form of a string array, with each parent and the
    target child as separate elements in the array, like ["parentOfParent",
    "parent", "child"].

`appName` [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0) (Optional)
:   The name of the Object Repository application where you want to access the
    desired UI element.

`appVersion` [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0) (Optional)
:   The version of the Object Repository application from where you want to
    access the desired UI element.

`screenName` [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0) (Optional)
:   The name of the Object Repository screen from where you want to access the
    desired UI element.

## ObjectRepositoryTarget properties

### `AppName`

**Property Value**:  [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0)

The name of the Object Repository application where you want to access the desired UI
element.

```
public string AppName { get; set; }
```

### `AppVersion`

**Property Value**:  [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0)

The version of the Object Repository application from where you want to access
the desired UI
element.

```
public string AppVersion { get; set; }
```

### `ElementPath`

**Property Value**:  [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0)

The name of the Object Repository UI element that you want to
access.

```
public string[] ElementPath { get; set; }
```

### `ScreenName`

**Property Value**:  [String](https://learn.microsoft.com/en-us/dotnet/api/system.string?view=net-8.0)

The name of the Object Repository screen from where you want to access the
desired UI
element.

```
public string ScreenName { get; set; }
```
