Interface HtmlUnitDriver.JavaScriptResultsCollection

  • Enclosing class:
    HtmlUnitDriver

    protected static interface HtmlUnitDriver.JavaScriptResultsCollection
    Represents a JavaScript array-like result set returned from script execution.

    This interface abstracts collection-like objects that may be returned from JavaScript (e.g., arrays, NodeLists, or custom JS collections). It provides minimal operations needed to iterate over such results.

    • Method Detail

      • getLength

        int getLength()
        Returns the number of items in the collection.
        Returns:
        the collection length
      • item

        Object item​(int index)
        Returns the item at the specified index within the collection.
        Parameters:
        index - the zero-based index of the item to retrieve
        Returns:
        the object at the specified index, or null if none exists