# Context: Inflectra Rapise API (AndroidObject / UI Navigation)

When writing JavaScript code for Inflectra Rapise test automation for Android, 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 Android Properties (use these exactly as strings in `GetProperty`):**
*   **Identity & Content:** 
    *   `class` (e.g., "android.view.ViewGroup")
    *   `content-desc` (e.g., "Sign In")
    *   `package` (e.g., "com.yourcompany.libraryapp")
    *   `resource-id` (Android element ID)
    *   `text` (Visible text on the element)
    *   `index` (0-based index of the element within its parent)
*   **State / Booleans (returned as string "true" or "false"):**
    *   `checkable`, `checked`
    *   `clickable`, `long-clickable`
    *   `enabled`
    *   `focusable`, `focused`
    *   `scrollable`
    *   `selected`
    *   `password`
*   **Geometry:**
    *   `bounds` (e.g., "[106,1127][976,1258]")

**Shortcut Reading Methods:**
*   `GetName()`: Returns the name of the object.
*   `GetClass()`: Returns the underlying class name (same as `GetProperty('class')`).
*   `GetText()`: Returns the visible text of the object (same as `GetProperty('text')`).
*   `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()`: Clicks in the middle of the control.
*   `DoEnsureVisible()`: Ensures the item is visible on screen.

## Code Examples for the AI:

**Example 1: Checking specific Android properties of children**
```javascript
var parentEl = SeS('MyListObject');
var count = parentEl.GetChildCount();

for (var i = 0; i < count; i++) {
    var child = parentEl.GetChildAt(i);
    if (child) {
        var contentDesc = child.GetProperty('content-desc');
        var isClickable = child.GetProperty('clickable'); 
        var isEnabled = child.GetProperty('enabled');
        
        if (isClickable === "true" && isEnabled === "true") {
            Tester.Message("Interactable Child Found: " + contentDesc);
        }
    }
}
```

**Example 2: Finding an element by resource-id or class**
```javascript
var currentEl = SeS('MyListItem');

while (currentEl != null) {
    var resId = currentEl.GetProperty('resource-id');
    var className = currentEl.GetProperty('class');
    
    if (className === "android.view.ViewGroup" && currentEl.GetProperty('content-desc') === "Sign In") {
        Tester.Message("Found Sign In button!");
        currentEl.DoAction();
        break;
    }
    currentEl = currentEl.GetNextSibling();
}
```
