# Context: Inflectra Rapise API (iOSObject / UI Navigation)

When writing JavaScript code for Inflectra Rapise test automation for iOS, use the following API to navigate the element tree and read properties. Objects are accessed via `SeS('ObjectName')`. 

## 1. Tree Navigation API
These methods are used to traverse the UI element tree. They return adjacent nodes as objects.
*   `GetParent()`: Returns the parent element (Object).
*   `GetNextSibling()`: Returns the next sibling element (Object).
*   `GetPrevSibling()`: Returns the previous sibling element (Object).
*   `GetChildCount()`: Returns the number of child items (Number).
*   `GetChildAt(index)`: Returns the child object at the specified 0-based `index` (Object/String).

## 2. Property Reading API
These methods extract information from the current node. 

**Standard Property Accessor:**
*   `GetProperty(propertyName)`: Returns the value of a specific named property (String). 

**Available iOS Properties (use these exactly as strings in `GetProperty`):**
*   **Identity & Content:** 
    *   `name` (e.g., "Master - Detail Table View")
    *   `label` (e.g., "Master - Detail Table View")
    *   `value` (e.g., "Master - Detail Table View")
    *   `hint` (Placeholder text or accessibility hint)
    *   `path` (XPath or hierarchy path of the element)
    *   `dom` (DOM structure if within a webview context)
*   **State / Booleans (returned as string "true" or "false"):**
    *   `enabled` 
    *   `visible`
    *   `valid`
*   **Geometry:**
    *   `x` (X coordinate)
    *   `y` (Y coordinate)
    *   `width` (Width of the element)
    *   `height` (Height of the element)

**Shortcut Reading Methods:**
*   `GetName()`: Returns the name of the object (often matches the 'name' property).
*   `GetText()`: Returns the visible text of the object (often maps to 'label' or 'value').
*   `GetX()` / `GetY()`: Returns the top-left X/Y coordinates on the screen.
*   `GetWidth()` / `GetHeight()`: Returns the dimensions of the object.

## 3. Standard Action API
*   `DoClick(x, y)`: Clicks the control. Optional `x` and `y` offsets.
*   `DoSendKeys(keys)`: Sends text to the object character-by-character.
*   `DoClear()`: Clears the text of the object.
*   `DoAction()`: Taps in the middle of the control.
*   `DoEnsureVisible()`: Ensures the item is visible on screen.

## Code Examples for the AI:

**Example 1: Checking specific iOS properties of children**
```javascript
var parentEl = SeS('MyTableView');
var count = parentEl.GetChildCount();

for (var i = 0; i < count; i++) {
    var child = parentEl.GetChildAt(i);
    if (child) {
        var elLabel = child.GetProperty('label');
        var isVisible = child.GetProperty('visible'); 
        var isEnabled = child.GetProperty('enabled');
        
        if (isVisible === "true" && isEnabled === "true") {
            Tester.Message("Interactable iOS Element Found: " + elLabel);
        }
    }
}
```

**Example 2: Finding an element by label or name**
```javascript
var currentEl = SeS('MyFirstListItem');

while (currentEl != null) {
    var elName = currentEl.GetProperty('name');
    var elLabel = currentEl.GetProperty('label');
    
    if (elName === "Master - Detail Table View" || elLabel === "Master - Detail Table View") {
        Tester.Message("Found Target View!");
        currentEl.DoAction();
        break;
    }
    currentEl = currentEl.GetNextSibling();
}
```
