### Configure iOS Driver with Appium Settings Source: https://alumnium.ai/docs/guides/mcp Example of capabilities for starting an iOS driver session. Includes Appium-specific settings for element interaction. ```json { "platformName": "ios", "appium:settings": { "allowInvisibleElements": true, "ignoreUnimportantViews": true } } ``` -------------------------------- ### Install Dependencies Source: https://alumnium.ai/docs/writing-first-test/appium Commands to install necessary packages for Python and Node.js environments. ```bash $ pip install alumnium pytest ``` ```bash $ npx appium driver install xcuitest $ npx appium ``` ```bash $ npm install alumnium ``` ```bash $ npm init wdio $ rm test/specs/test.e2e.ts ``` -------------------------------- ### Configure Chrome Driver with Alumnium Options Source: https://alumnium.ai/docs/guides/mcp Example of capabilities for starting a Chrome driver session. Includes options for change analysis, planner, excluded attributes, and driver settings. ```json { "platformName": "chrome", "alumnium:options": { "changeAnalysis": true, "planner": false, "excludedAttributes": ["url"], "driverSettings": { "autoswitchToNewTab": false } } } ``` -------------------------------- ### Setup Browser Instance Source: https://alumnium.ai/docs/writing-first-test/appium Initializes a browser session for mobile testing using Appium or WebdriverIO. ```python from appium.options.ios import XCUITestOptions from appium.webdriver.webdriver import WebDriver from pytest import fixture @fixture def driver(): options = XCUITestOptions() options.automation_name = "XCUITest" options.bundle_id = "com.apple.mobilesafari" options.device_name = "iPhone 16" options.no_reset = True options.platform_name = "iOS" options.platform_version = "18.5" driver = WebDriver(options=options) yield driver def test_search(driver: WebDriver): driver.get("https://duckduckgo.com") ``` ```typescript import { browser, expect } from "@wdio/globals"; describe("TestSearch", () => { it("should search", async () => { await browser.url("https://duckduckgo.com"); }); }); ``` -------------------------------- ### Setup Browser Instance with Mocha (TypeScript) Source: https://alumnium.ai/docs/writing-first-test/selenium Set up a WebDriver instance for Chrome using Selenium WebDriver and configure it for use with Mocha. Ensure proper setup and teardown of the driver. ```typescript import { strict as assert } from "assert"; import { Builder, Browser, type WebDriver } from "selenium-webdriver"; describe("TestSearch", () => { let driver: WebDriver; before(async () => { driver = await new Builder().forBrowser(Browser.CHROME).build(); }); after(async () => { await driver.quit(); }); it("should search", async () => { await driver.get("https://duckduckgo.com"); }); }); ``` -------------------------------- ### Basic Python Test Setup with Playwright Source: https://alumnium.ai/docs/writing-first-test/playwright Set up a basic Python test file using Playwright to navigate to a URL. This snippet requires pytest-playwright to be installed. ```python from playwright.sync_api import Page def test_search(page: Page): page.goto("https://duckduckgo.com") ``` -------------------------------- ### Setup Browser Driver Source: https://alumnium.ai/docs/getting-started/writing-first-test Initializes a Chrome browser instance for testing using pytest or Mocha. ```python from selenium.webdriver import Chrome from pytest import fixture @fixture def driver(): driver = Chrome() yield driver driver.quit() def test_search(driver: Chrome): driver.get("https://duckduckgo.com") ``` ```typescript import { strict as assert } from "assert"; import { Builder, Browser, type WebDriver } from "selenium-webdriver"; describe("TestSearch", () => { let driver: WebDriver; before(async () => { driver = await new Builder().forBrowser(Browser.CHROME).build(); }); after(async () => { await driver.quit(); }); it("should search", async () => { await driver.get("https://duckduckgo.com"); }); }); ``` -------------------------------- ### Initialize Playwright Project Source: https://alumnium.ai/docs/writing-first-test/playwright Initialize a new Playwright project and remove the default example test file. ```bash $ npm init playwright $ rm tests/example.spec.ts ``` -------------------------------- ### Install Alumnium with Pytest (Python) Source: https://alumnium.ai/docs/writing-first-test/selenium Install the Alumnium library and pytest for Python testing. Ensure Alumnium is installed in your project. ```bash $ pip install alumnium pytest ``` -------------------------------- ### Install Alumnium Dependencies Source: https://alumnium.ai/docs/getting-started/writing-first-test Commands to install the necessary packages for Python and Node.js environments. ```bash $ pip install alumnium pytest ``` ```bash $ npm install alumnium mocha $ npm install ts-node @types/mocha @types/selenium-webdriver # for TypeScript ``` -------------------------------- ### Setup Alumnium Integration Source: https://alumnium.ai/docs/writing-first-test/appium Instantiates the Alumnium client within test fixtures. ```python from alumnium import Alumni from appium.options.ios import XCUITestOptions from appium.webdriver.webdriver import WebDriver from pytest import fixture @fixture def driver(): options = XCUITestOptions() options.automation_name = "XCUITest" options.bundle_id = "com.apple.mobilesafari" options.device_name = "iPhone 16" options.no_reset = True options.platform_name = "iOS" options.platform_version = "18.5" driver = WebDriver(options=options) yield driver @fixture def al(driver: WebDriver): al = Alumni(driver) yield al al.quit() def test_search(al: Alumni, driver: WebDriver): driver.get("https://duckduckgo.com") ``` ```bash $ pytest --quiet ... 1 passed in 3.70s ``` ```typescript import { Alumni } from "alumnium"; import { browser, expect } from "@wdio/globals"; describe("TestSearch", () => { let al: Alumni; before(async () => { al = new Alumni(browser); }); after(async () => { await al.quit(); }); it("should search", async () => { await browser.url("https://duckduckgo.com"); }); }); ``` ```bash $ npx wdio run wdio.conf.ts ... Spec Files: 1 passed, 1 total (100% completed) in 00:00:08 ``` -------------------------------- ### Install Dependencies with NPM Source: https://alumnium.ai/docs/writing-first-test/playwright Install the Alumnium package in your project using npm. ```bash $ npm install alumnium ``` -------------------------------- ### Initialize Alumnium Instance Source: https://alumnium.ai/docs/getting-started/writing-first-test Integrates the Alumnium client into the test setup. ```python from alumnium import Alumni from selenium.webdriver import Chrome from pytest import fixture @fixture def driver(): driver = Chrome() yield driver driver.quit() @fixture def al(driver: Chrome): al = Alumni(driver) yield al al.quit() def test_search(al: Alumni, driver: Chrome): driver.get("https://duckduckgo.com") ``` ```typescript import { strict as assert } from "assert"; import { Alumni } from "alumnium"; import { Builder, Browser, type WebDriver } from "selenium-webdriver"; describe("TestSearch", () => { let driver: WebDriver; let al: Alumni; before(async () => { driver = await new Builder().forBrowser(Browser.CHROME).build(); al = new Alumni(driver); }); after(async () => { await driver.quit(); await al.quit(); }); it("should search", async () => { await driver.get("https://duckduckgo.com"); }); }); ``` -------------------------------- ### Mocha Test Setup for Alumnium Source: https://alumnium.ai/docs/writing-first-test/selenium Sets up WebDriver and Alumnium for use with Mocha. Ensure Alumnium and selenium-webdriver are installed. ```typescript import { strict as assert } from "assert"; import { Alumni } from "alumnium"; import { Builder, Browser, type WebDriver } from "selenium-webdriver"; describe("TestSearch", () => { let driver: WebDriver; let al: Alumni; before(async () => { driver = await new Builder().forBrowser(Browser.CHROME).build(); al = new Alumni(driver); }); after(async () => { await driver.quit(); await al.quit(); }); it("should search", async () => { await driver.get("https://duckduckgo.com"); await al.do("search for 'Mercury element' and press Enter"); await al.check("page title contains Aluminium word"); }); }); ``` -------------------------------- ### Install Alumnium for Python Source: https://alumnium.ai/docs/getting-started/installation Use pip to install the Alumnium package in a Python 3+ environment. ```bash pip install alumnium ``` -------------------------------- ### Install Alumnium with Mocha (Node.js) Source: https://alumnium.ai/docs/writing-first-test/selenium Install Alumnium and Mocha for Node.js testing. For TypeScript, also install ts-node and related types. ```bash $ npm install alumnium mocha $ npm install ts-node @types/mocha @types/selenium-webdriver # for TypeScript ``` -------------------------------- ### Setup Alumnium Instance with Pytest (Python) Source: https://alumnium.ai/docs/writing-first-test/selenium Instantiate the Alumnium client using a Selenium WebDriver instance within a pytest fixture. The fixture ensures proper setup and teardown of the Alumnium instance. ```python from alumnium import Alumni from selenium.webdriver import Chrome from pytest import fixture @fixture def driver(): driver = Chrome() yield driver driver.quit() @fixture def al(driver: Chrome): al = Alumni(driver) yield al al.quit() def test_search(al: Alumni, driver: Chrome): driver.get("https://duckduckgo.com") ``` -------------------------------- ### JavaScript: Set up WebDriver and Alumnium for WebdriverIO Source: https://alumnium.ai/docs/writing-first-test/appium This setup initializes the Alumnium client with the WebdriverIO browser instance. Ensure WebdriverIO is configured correctly. ```javascript import { Alumni } from "alumnium"; import { browser, expect } from "@wdio/globals"; describe("TestSearch", () => { let al: Alumni; before(async () => { al = new Alumni(browser); }); after(async () => { await al.quit(); }); it("should search", async () => { await browser.url("https://duckduckgo.com"); await al.do("search for 'Mercury element' and press Enter"); await al.check("page title contains Aluminium word"); }); }); ``` -------------------------------- ### Configure WebdriverIO Source: https://alumnium.ai/docs/writing-first-test/appium Example configuration for iOS Safari capabilities. ```typescript export const config: WebdriverIO.Config = { // other options capabilities: [ { platformName: "iOS", browserName: "Safari", "appium:automationName": "XCUITest", "appium:deviceName": "iPhone 16", "appium:platformVersion": "18.5", }, ], // other options }; ``` -------------------------------- ### Basic TypeScript Test Setup with Playwright Source: https://alumnium.ai/docs/writing-first-test/playwright Set up a basic TypeScript test file using Playwright to navigate to a URL. ```typescript import { test, expect } from "@playwright/test"; test("should search", async ({ page }) => { await page.goto("https://duckduckgo.com"); }); ``` -------------------------------- ### Install Dependencies with Pip and Playwright Source: https://alumnium.ai/docs/writing-first-test/playwright Install Alumnium and pytest-playwright using pip. Then, install the necessary browser binaries for Playwright. ```bash $ pip install alumnium pytest-playwright $ playwright install chromium ``` -------------------------------- ### Install Alumnium for TypeScript Source: https://alumnium.ai/docs/getting-started/installation Use a Node.js package manager to install Alumnium in a Node.js 18+ environment. ```bash npm install alumnium ``` ```bash pnpm add alumnium ``` ```bash yarn add alumnium ``` -------------------------------- ### Setup Alumnium Instance with Mocha (TypeScript) Source: https://alumnium.ai/docs/writing-first-test/selenium Initialize Alumnium client with WebDriver and configure Mocha for testing. The before and after hooks manage the lifecycle of the driver and Alumnium instance. ```typescript import { strict as assert } from "assert"; import { Alumni } from "alumnium"; import { Builder, Browser, type WebDriver } from "selenium-webdriver"; describe("TestSearch", () => { let driver: WebDriver; let al: Alumni; before(async () => { driver = await new Builder().forBrowser(Browser.CHROME).build(); al = new Alumni(driver); }); after(async () => { await driver.quit(); await al.quit(); }); it("should search", async () => { await driver.get("https://duckduckgo.com"); }); }); ``` -------------------------------- ### Setup Browser Instance with Pytest (Python) Source: https://alumnium.ai/docs/writing-first-test/selenium Instantiate a Chrome browser instance using Selenium and pytest fixtures. The fixture ensures the driver is properly quit after the test. ```python from selenium.webdriver import Chrome from pytest import fixture @fixture def driver(): driver = Chrome() yield driver driver.quit() def test_search(driver: Chrome): driver.get("https://duckduckgo.com") ``` -------------------------------- ### Start Alumnium Server with Docker Source: https://alumnium.ai/docs/writing-first-test/playwright Run the Alumnium server in detached mode using Docker. Ensure ALUMNIUM_MODEL and OPENAI_API_KEY environment variables are set. ```bash $ docker run --rm --detach \ --publish 8013:8013 \ --env ALUMNIUM_MODEL \ --env OPENAI_API_KEY \ alumnium/alumnium ``` -------------------------------- ### Install Alumnium MCP for Codex Source: https://alumnium.ai/docs/guides/mcp Use this command to add the Alumnium MCP server for use with Codex. Ensure your OPENAI_API_KEY is set. ```bash codex mcp add alumnium --env OPENAI_API_KEY=... -- uvx --from alumnium alumnium-mcp ``` -------------------------------- ### Pytest Fixtures for Alumnium Source: https://alumnium.ai/docs/writing-first-test/selenium Sets up pytest fixtures for WebDriver and Alumnium. Ensure Alumnium is installed. ```python from alumnium import Alumni from selenium.webdriver import Chrome from pytest import fixture @fixture def driver(): driver = Chrome() yield driver driver.quit() @fixture def al(driver: Chrome): al = Alumni(driver) yield al al.quit() ``` -------------------------------- ### Install Alumnium MCP for Gemini CLI Source: https://alumnium.ai/docs/guides/mcp Use this command to add the Alumnium MCP server for use with the Gemini CLI. Ensure your OPENAI_API_KEY is set. ```bash gemini mcp add alumnium --env OPENAI_API_KEY=... uvx --from alumnium alumnium-mcp ``` -------------------------------- ### Python: Set up WebDriver and Alumnium for iOS Source: https://alumnium.ai/docs/writing-first-test/appium This fixture sets up the WebDriver for iOS using Appium and initializes the Alumnium client. Ensure Appium and necessary drivers are installed. ```python from alumnium import Alumni from appium.options.ios import XCUITestOptions from appium.webdriver.webdriver import WebDriver from pytest import fixture @fixture def driver(): options = XCUITestOptions() options.automation_name = "XCUITest" options.bundle_id = "com.apple.mobilesafari" options.device_name = "iPhone 16" options.no_reset = True options.platform_name = "iOS" options.platform_version = "18.5" driver = WebDriver(options=options) yield driver @fixture def al(driver: WebDriver): al = Alumni(driver) yield al al.quit() ``` -------------------------------- ### Python Test Setup and Search Source: https://alumnium.ai/docs/getting-started/writing-first-test Sets up the Chrome driver and Alumnium instance using pytest fixtures. Performs a search and verifies page title and search results. ```python from alumnium import Alumni from selenium.webdriver import Chrome from pytest import fixture @fixture def driver(): driver = Chrome() yield driver driver.quit() @fixture def al(driver: Chrome): al = Alumni(driver) yield al al.quit() def test_search(al: Alumni, driver: Chrome): driver.get("https://duckduckgo.com") al.do("search for 'Mercury element' and press Enter") al.check("page title contains Mercury word") al.check("search results contain Wikipedia articles") symbol = al.get("chemical symbol") assert symbol == "Al" ``` -------------------------------- ### Setup and Test Search with Alumnium (Python) Source: https://alumnium.ai/docs/writing-first-test/appium Sets up an iOS driver for Safari, initializes Alumnium, performs a search for 'Mercury element', checks for specific page content, and asserts the chemical symbol. This snippet is used to demonstrate a failing test. ```python from alumnium import Alumni from appium.options.ios import XCUITestOptions from appium.webdriver.webdriver import WebDriver from pytest import fixture @fixture def driver(): options = XCUITestOptions() options.automation_name = "XCUITest" options.bundle_id = "com.apple.mobilesafari" options.device_name = "iPhone 16" options.no_reset = True options.platform_name = "iOS" options.platform_version = "18.5" driver = WebDriver(options=options) yield driver @fixture def al(driver: WebDriver): al = Alumni(driver) yield al al.quit() def test_search(al: Alumni, driver: WebDriver): driver.get("https://duckduckgo.com") al.do("search for 'Mercury element' and press Enter") al.check("page title contains Mercury word") al.check("search results contain Wikipedia articles") symbol = al.get("chemical symbol") assert symbol == "Al" ``` -------------------------------- ### Tool: get Source: https://alumnium.ai/docs/guides/mcp Extracts data from the application based on natural language descriptions. ```APIDOC ## get ### Description Extract data from the application. If data is not found, returns an explanation. Captures a screenshot upon completion. ``` -------------------------------- ### JavaScript Test Setup and Search Source: https://alumnium.ai/docs/getting-started/writing-first-test Sets up the WebDriver and Alumnium instance for testing. Performs a search on DuckDuckGo and verifies page title and search result content. ```javascript import { strict as assert } from "assert"; import { Alumni } from "alumnium"; import { Builder, Browser, type WebDriver } from "selenium-webdriver"; describe("TestSearch", () => { let driver: WebDriver; let al: Alumni; before(async () => { driver = await new Builder().forBrowser(Browser.CHROME).build(); al = new Alumni(driver); }); after(async () => { await driver.quit(); await al.quit(); }); it("should search", async () => { await driver.get("https://duckduckgo.com"); await al.do("search for 'Mercury element' and press Enter"); await al.check("page title contains Mercury word"); await al.check("search results do not contain Wikipedia articles"); await al.check("search results contain Wikipedia articles"); }); ``` -------------------------------- ### Run Mocha Command After Alumnium Setup Source: https://alumnium.ai/docs/writing-first-test/selenium Execute Mocha tests after integrating Alumnium. This command runs the tests and provides a summary of the execution. ```bash $ npx mocha TestSearch ✔ should search (813ms) 1 passing (3s) ``` -------------------------------- ### Install Alumnium MCP for Claude Code Source: https://alumnium.ai/docs/guides/mcp Use this command to add the Alumnium MCP server for use with Claude Code. Ensure your OPENAI_API_KEY is set. ```bash claude mcp add alumnium --env OPENAI_API_KEY=... -- uvx --from alumnium alumnium-mcp ``` -------------------------------- ### Perform basic search verification in TypeScript Source: https://alumnium.ai/docs/writing-first-test/selenium Initial test setup using Mocha and Selenium to verify search results on DuckDuckGo. ```typescript import { strict as assert } from "assert"; import { Alumni } from "alumnium"; import { Builder, Browser, type WebDriver } from "selenium-webdriver"; describe("TestSearch", () => { let driver: WebDriver; let al: Alumni; before(async () => { driver = await new Builder().forBrowser(Browser.CHROME).build(); al = new Alumni(driver); }); after(async () => { await driver.quit(); await al.quit(); }); it("should search", async () => { await driver.get("https://duckduckgo.com"); await al.do("search for 'Mercury element' and press Enter"); await al.check("page title contains Mercury word"); await al.check("search results do not contain Wikipedia articles"); await al.check("search results contain Wikipedia articles"); }); ``` -------------------------------- ### Retrieve data with Python Source: https://alumnium.ai/docs/writing-first-test/selenium Example of using Alumnium to extract data from a page using Pytest fixtures. ```python from alumnium import Alumni from selenium.webdriver import Chrome from pytest import fixture @fixture def driver(): driver = Chrome() yield driver driver.quit() @fixture def al(driver: Chrome): al = Alumni(driver) yield al al.quit() def test_search(al: Alumni, driver: Chrome): driver.get("https://duckduckgo.com") al.do("search for 'Mercury element' and press Enter") al.check("page title contains Mercury word") al.check("search results contain Wikipedia articles") symbol = al.get("chemical symbol") assert symbol == "Al" ``` -------------------------------- ### Run Python Playwright Test with Alumnium Source: https://alumnium.ai/docs/writing-first-test/playwright Execute the Python Playwright test, which now includes the Alumnium fixture, to verify the setup. ```bash $ pytest --quiet --headed ... 1 passed in 7.81s ``` -------------------------------- ### Get Data Using Vision Mode Source: https://alumnium.ai/docs/guides/retrievals Retrieve data by analyzing screenshots using the 'vision' option. This ignores the accessibility tree. ```python al.get("number of pending tasks", vision=True) ``` ```javascript await al.get("number of pending tasks", { vision: true }); ``` -------------------------------- ### Setup and Test Search with Alumnium (JavaScript) Source: https://alumnium.ai/docs/writing-first-test/appium Sets up a WebdriverIO browser instance, initializes Alumnium, performs a search for 'Mercury element', checks for specific page content, and asserts the chemical symbol. This snippet is used to demonstrate a failing test. ```javascript import { Alumni } from "alumnium"; import { browser, expect } from "@wdio/globals"; describe("TestSearch", () => { let al: Alumni; before(async () => { al = new Alumni(browser); }); after(async () => { await al.quit(); }); it("should search", async () => { await browser.url("https://duckduckgo.com"); await al.do("search for 'Mercury element' and press Enter"); await al.check("page title contains Mercury word"); await al.check("search results contain Wikipedia articles"); const symbol = await al.get("chemical symbol"); expect(symbol).toEqual("Al"); }); }); ``` -------------------------------- ### Run Pytest Command After Alumnium Setup Source: https://alumnium.ai/docs/writing-first-test/selenium Re-run pytest tests after setting up Alumnium to ensure integration. This command executes the tests and reports the outcome. ```bash $ pytest --quiet ... 1 passed in 7.81s ``` -------------------------------- ### TypeScript Test Setup and Execution Source: https://alumnium.ai/docs/writing-first-test/playwright Sets up and executes a test using Playwright and Alumnium in TypeScript. It navigates to a page, performs a search, checks for specific content, and asserts the retrieved chemical symbol. ```typescript import { test, expect } from "."; test("should search", async ({ page, al }) => { await page.goto("https://duckduckgo.com"); await al.do("search for 'Mercury element' and press Enter"); await al.check("page title contains Mercury word"); await al.check("search results contain Wikipedia articles"); const symbol = await al.get("chemical symbol"); expect(symbol).toBe("Al"); }); ``` -------------------------------- ### Basic Search Test with Alumnium (Pytest) Source: https://alumnium.ai/docs/writing-first-test/selenium Performs a search and checks if the page title contains a specific word. This example is designed to fail initially. ```python def test_search(al: Alumni, driver: Chrome): driver.get("https://duckduckgo.com") al.do("search for 'Mercury element' and press Enter") al.check("page title contains Aluminium word") ``` -------------------------------- ### Cache Management in GitHub Actions Source: https://alumnium.ai/docs/guides/caching Configure the `actions/cache` action in GitHub Actions to save and restore the Alumnium cache. This example sets a cache key based on the commit SHA and provides a fallback restore key. ```yaml - uses: actions/cache@v4 with: path: .alumnium/cache/ key: alumnium-cache-${{ github.sha }} restore-keys: alumnium-cache- ``` -------------------------------- ### Python Test Setup and Execution Source: https://alumnium.ai/docs/writing-first-test/playwright Sets up the Alumnium fixture for Playwright tests. This fixture initializes Alumnium, yields it to the test function, and ensures proper cleanup afterwards. It's used for performing actions and checks on a web page. ```python from alumnium import Alumni from playwright.sync_api import Page from pytest import fixture @fixture def al(page: Page): al = Alumni(page) yield al al.quit() ``` ```python def test_search(al: Alumni, page: Page): page.goto("https://duckduckgo.com") al.do("search for 'Mercury element' and press Enter") al.check("page title contains Mercury word") al.check("search results contain Wikipedia articles") symbol = al.get("chemical symbol") assert symbol == "Al" ``` -------------------------------- ### Get Data Using Focused Areas (Python) Source: https://alumnium.ai/docs/guides/areas Define a specific UI area to improve test efficiency and accuracy. All Alumnium methods can be used on the located area. ```python area = al.area("'Example 1' table") assert area.get("last names") == ["Smith", "Bach", "Doe", "Conway"] assert area.get("first names") == ["John", "Frank", "Jason", "Tim"] ``` -------------------------------- ### Tool: start_driver Source: https://alumnium.ai/docs/guides/mcp Initializes a browser or mobile driver session using Appium, Selenium, or Playwright. ```APIDOC ## start_driver ### Description Initializes the browser or mobile driver session. Supports platformName (chrome, ios, android) and configuration via alumnium:options or appium:settings. ### Request Example { "platformName": "chrome", "alumnium:options": { "changeAnalysis": true, "planner": false } } ``` -------------------------------- ### Fetch Accessibility Tree Source: https://alumnium.ai/docs/guides/mcp Retrieves the raw accessibility tree of the current page as XML. This is useful for debugging when `do`, `check`, or `get` behave unexpectedly. Inspect the tree to verify element visibility, roles, and attributes. ```APIDOC ## Fetch Accessibility Tree ### Description Returns the raw accessibility tree of the current page as XML. Useful for debugging when `do`, `check`, or `get` behave unexpectedly - inspect the tree to verify element visibility, roles, and attributes. ### Method GET ### Endpoint /websites/alumnium_ai/fetch_accessibility_tree ### Parameters ### Request Body ### Request Example ### Response #### Success Response (200) - **accessibility_tree** (string) - The raw accessibility tree in XML format. #### Response Example { "accessibility_tree": "" } ``` -------------------------------- ### Mark tasks complete Source: https://alumnium.ai/docs/guides/actions Demonstrates how to provide concrete instructions to achieve a specific UI interaction. ```python al.do("mark all tasks complete") ``` ```javascript await al.do("mark all tasks complete"); ``` -------------------------------- ### Download Ollama Model Source: https://alumnium.ai/docs/getting-started/configuration Download the Mistral Small 3.1 24B model for local inference using Ollama. ```bash ollama pull mistral-small3.1:24b ``` -------------------------------- ### Retrieve data with TypeScript Source: https://alumnium.ai/docs/writing-first-test/selenium Example of using Alumnium to extract data from a page in a Mocha test suite. ```typescript import { strict as assert } from "assert"; import { Alumni } from "alumnium"; import { Builder, Browser, type WebDriver } from "selenium-webdriver"; describe("TestSearch", () => { let driver: WebDriver; let al: Alumni; before(async () => { driver = await new Builder().forBrowser(Browser.CHROME).build(); al = new Alumni(driver); }); after(async () => { await driver.quit(); await al.quit(); }); it("should search", async () => { await driver.get("https://duckduckgo.com"); await al.do("search for 'Mercury element' and press Enter"); await al.check("page title contains Mercury word"); await al.check("search results contain Wikipedia articles"); const symbol = await al.get("chemical symbol"); assert.equal(symbol, "Al"); }); }); ``` -------------------------------- ### Run Tests Source: https://alumnium.ai/docs/writing-first-test/appium Commands to execute test suites. ```bash $ pytest --quiet ... 1 passed in 3.73s ``` ```bash $ npx wdio run wdio.conf.ts [Safari iOS #0-0] Running: Safari on iOS [Safari iOS #0-0] Session ID: 29eb39f3-1ca6-4349-bb07-6ea545e8a3e9 [Safari iOS #0-0] [Safari iOS #0-0] » test/specs/search.e2e.ts [Safari iOS #0-0] TestSearch [Safari iOS #0-0] ✓ should search [Safari iOS #0-0] [Safari iOS #0-0] 1 passing (1.6s) Spec Files: 1 passed, 1 total (100% completed) in 00:00:09 ``` -------------------------------- ### Configure Google AI Provider Source: https://alumnium.ai/docs/getting-started/configuration Set the ALUMNIUM_MODEL to 'google' and provide your Google API key. ```bash export ALUMNIUM_MODEL="google" export GOOGLE_API_KEY="..." ``` -------------------------------- ### Initialize Alumnium with extra tools Source: https://alumnium.ai/docs/guides/actions Configures the Alumnium instance with additional tools for extended automation capabilities. ```python from alumnium import Alumni from alumnium.tools import NavigateBackTool al = Alumni(driver, extra_tools=[NavigateBackTool]) ``` ```javascript import { Alumni, NavigateBackTool } from "alumnium"; const al = new Alumni(driver, { extraTools: [NavigateBackTool] }); ``` -------------------------------- ### Get Number of Pending Tasks Source: https://alumnium.ai/docs/guides/retrievals Use 'al.get' to retrieve a count of pending tasks. This can be used directly or with an await keyword for asynchronous operations. ```python al.get("number of pending tasks") ``` ```javascript await al.get("number of pending tasks"); ``` -------------------------------- ### Tool: do Source: https://alumnium.ai/docs/guides/mcp Executes natural language automation commands within the active driver session. ```APIDOC ## do ### Description Perform actions in the application using natural language commands. Returns a summary of steps and captures a screenshot. ``` -------------------------------- ### TypeScript Test Fixture for Alumnium Integration Source: https://alumnium.ai/docs/writing-first-test/playwright Extend Playwright's test functionality in TypeScript to include an Alumnium instance, managing its setup and teardown. ```typescript import { test as base } from "@playwright/test"; import { Alumni } from "alumnium"; export const test = base.extend<{ al: Alumni }>({ al: async ({ page }, use) => { const al = new Alumni(page); await use(al); await al.quit(); }, }); export { expect } from "@playwright/test"; ``` -------------------------------- ### Run Tests with Alumnium Source: https://alumnium.ai/docs/getting-started/writing-first-test Commands to verify tests after integrating Alumnium. ```bash $ pytest --quiet ... 1 passed in 7.81s ``` ```bash $ npx mocha TestSearch ✔ should search (813ms) 1 passing (3s) ``` -------------------------------- ### Configure GitHub AI Provider Source: https://alumnium.ai/docs/getting-started/configuration Set the ALUMNIUM_MODEL to 'github' and provide your GitHub personal access token. ```bash export ALUMNIUM_MODEL="github" export OPENAI_API_KEY="github_pat-..." ``` -------------------------------- ### Configure xAI AI Provider Source: https://alumnium.ai/docs/getting-started/configuration Set the ALUMNIUM_MODEL to 'xai' and provide your xAI API key. ```bash export ALUMNIUM_MODEL="xai" export XAI_API_KEY="xai-..." ``` -------------------------------- ### JavaScript Test for Searching Mercury Element Source: https://alumnium.ai/docs/writing-first-test/selenium This JavaScript snippet uses Mocha and Selenium to test searching for 'Mercury element'. Ensure you have selenium-webdriver and alumnium installed. ```javascript import { strict as assert } from "assert"; import { Alumni } from "alumnium"; import { Builder, Browser, type WebDriver } from "selenium-webdriver"; describe("TestSearch", () => { let driver: WebDriver; let al: Alumni; before(async () => { driver = await new Builder().forBrowser(Browser.CHROME).build(); al = new Alumni(driver); }); after(async () => { await driver.quit(); await al.quit(); }); it("should search", async () => { await driver.get("https://duckduckgo.com"); await al.do("search for 'Mercury element' and press Enter"); }); }); ``` ```bash $ npx mocha ``` -------------------------------- ### Execute Python Test Case Source: https://alumnium.ai/docs/writing-first-test/appium Demonstrates a search test scenario using the Alumni instance. ```python def test_search(al: Alumni, driver: WebDriver): driver.get("https://duckduckgo.com") al.do("search for 'Mercury element' and press Enter") al.check("page title contains Mercury word") al.check("search results do not contain Wikipedia articles") al.check("search results contain Wikipedia articles") ``` -------------------------------- ### Configure OpenAI AI Provider Source: https://alumnium.ai/docs/getting-started/configuration Set the ALUMNIUM_MODEL to 'openai' and provide your OpenAI API key. ```bash export ALUMNIUM_MODEL="openai" export OPENAI_API_KEY="sk-proj-..." ``` -------------------------------- ### Configure Ollama AI Provider Source: https://alumnium.ai/docs/getting-started/configuration Set the ALUMNIUM_MODEL to 'ollama' and specify the Ollama URL if hosted remotely. ```bash export ALUMNIUM_MODEL="ollama" export ALUMNIUM_OLLAMA_URL="..." # if you host Ollama on a server ``` -------------------------------- ### Get Data Using Focused Areas (JavaScript) Source: https://alumnium.ai/docs/guides/areas Define a specific UI area to improve test efficiency and accuracy. All Alumnium methods can be used on the located area. ```javascript const area = await al.area("'Example 1' table"); expect(await area.get("last names")).toEqual(["Smith", "Bach", "Doe", "Conway"]); expect(await area.get("first names")).toEqual(["John", "Frank", "Jason", "Tim"]); ``` -------------------------------- ### Configure MistralAI AI Provider Source: https://alumnium.ai/docs/getting-started/configuration Set the ALUMNIUM_MODEL to 'mistralai' and provide your MistralAI API key. ```bash export ALUMNIUM_MODEL="mistralai" export MISTRAL_API_KEY="..." ``` -------------------------------- ### Get Specific Task Titles Source: https://alumnium.ai/docs/guides/retrievals Retrieve specific data like task titles, differentiating between all, completed, and pending tasks. Alumnium attempts to cast data to appropriate types. ```python assert al.get("titles of tasks") == ["buy milk", "buy bread", "buy honey", "buy water"] assert al.get("titles of complete tasks") == ["buy milk", "buy bread"] assert al.get("titles of pending tasks") == ["buy honey", "buy water"] ``` ```javascript expect(await al.get("titles of tasks")).toEqual(["buy milk", "buy bread", "buy honey", "buy water"]); expect(await al.get("titles of complete tasks")).toEqual(["buy milk", "buy bread"]); expect(await al.get("titles of pending tasks")).toEqual(["buy honey", "buy water"]); ``` -------------------------------- ### Locating elements with Python Source: https://alumnium.ai/docs/guides/elements Use find() to retrieve native elements and perform standard driver actions. ```python submit_button = al.find("submit button") submit_button.click() text_input = al.find("text input") text_input.send_keys("Hello Alumnium!") ``` -------------------------------- ### Configure Azure AI Foundry environment variables Source: https://alumnium.ai/docs/guides/self-hosting Set these variables to connect Alumnium to a deployed model on Azure AI Foundry. ```bash export ALUMNIUM_MODEL="azure_foundry" export AZURE_FOUNDRY_TARGET_URI="https://..." export AZURE_FOUNDRY_API_KEY="..." export AZURE_FOUNDRY_API_VERSION="..." ``` -------------------------------- ### Teach Alumnium new actions Source: https://alumnium.ai/docs/guides/actions Defines a goal and a sequence of actions to teach Alumnium how to handle specific tasks. ```python al.learn( goal='delete "Test" task', actions=[ 'hover "Test" task', 'click "x" button near "Test" task', ] ) ``` ```javascript await al.learn({ goal: 'delete "Test" task', actions: ['hover "Test" task', 'click "x" button near "Test" task'], }); ``` -------------------------------- ### TypeScript Test Failure Output Source: https://alumnium.ai/docs/writing-first-test/playwright Example output from a failed TypeScript Playwright test. It indicates that the assertion `expect(symbol).toBe("Al")` failed because the received value was 'Hg'. ```bash $ npx playwright test --project chromium --headed ... Expected: "Al" Received: "Hg" ... 1 failed (19.5s) ``` -------------------------------- ### Get Data Without Focusing Areas (JavaScript) Source: https://alumnium.ai/docs/guides/areas Use this method when you need to retrieve data from specific elements without defining a focused area. This approach can be less efficient for complex UIs. ```javascript const lastNames = await al.get("last names from 'Example 1' table"); const firstNames = await al.get("first names from 'Example 1' table"); expect(lastNames).toEqual(["Smith", "Bach", "Doe", "Conway"]); expect(firstNames).toEqual(["John", "Frank", "Jason", "Tim"]); ``` -------------------------------- ### Get Data Without Focusing Areas (Python) Source: https://alumnium.ai/docs/guides/areas Use this method when you need to retrieve data from specific elements without defining a focused area. This approach can be less efficient for complex UIs. ```python last_names = al.get("last names from 'Example 1' table") first_names = al.get("first names from 'Example 1' table") assert last_names == ["Smith", "Bach", "Doe", "Conway"] assert first_names == ["John", "Frank", "Jason", "Tim"] ``` -------------------------------- ### Run WebdriverIO Tests Source: https://alumnium.ai/docs/writing-first-test/appium Command to execute tests using the WebdriverIO CLI. ```bash $ npx wdio run wdio.conf.ts ... Spec Files: 1 passed, 1 total (100% completed) in 00:00:37 ``` -------------------------------- ### Tool: check Source: https://alumnium.ai/docs/guides/mcp Verifies application state and runs assertions using natural language. ```APIDOC ## check ### Description Verify application state and run assertions. Returns the result of the check with an explanation and captures a screenshot. ``` -------------------------------- ### Environment Variables Source: https://alumnium.ai/docs/reference Configuration options for Alumnium AI using environment variables. ```APIDOC ## Environment Variables The following environment variables can be used to control the behavior of Alumnium. ### `ALUMNIUM_CACHE` Sets the cache provider used by Alumnium. Supported values are: * `filesystem` (default) * `none` or `false` ### `ALUMNIUM_CACHE_PATH` Sets the directory where the filesystem cache is stored. Default is `.alumnium/cache`. ### `ALUMNIUM_CHANGE_ANALYSIS` Set to `true` to enable analysis of UI changes made by `do()`. When enabled, Alumnium captures the accessibility tree before and after each action and returns a description of what changed. Default is `false` when using Alumnium as a library and `true` when running Alumnium MCP server. ### `ALUMNIUM_DELAY` Delay in seconds between retries when an action fails. Default is `0.5`. ### `ALUMNIUM_EXCLUDE_ATTRIBUTES` Comma-separated list of accessibility tree attributes to exclude (e.g. `focusable,url`). Useful for reducing accessibility tree size on large pages. ### `ALUMNIUM_FULL_PAGE_SCREENSHOT` Set to `true` to capture full-page screenshots instead of viewport-only screenshots. Default is `false`. ### `ALUMNIUM_LOG_LEVEL` Sets the level used by Alumnium logger. Supported values are: * `debug` * `info` * `warning` (default) * `error` * `critical` ### `ALUMNIUM_LOG_PATH` Sets the output location used by Alumnium logger. Supported values are: * a path to a file (e.g. `alumnium.log`); * `stdout` to print logs to the standard output. ``` - name: Enable debug logging in Alumnium if: runner.debug == '1' run: | echo ALUMNIUM_LOG_LEVEL=debug >> "$GITHUB_ENV" echo ALUMNIUM_LOG_PATH=alumnium.log >> "$GITHUB_ENV" ``` ### `ALUMNIUM_MODEL` Select AI provider and model to use. Value| LLM| Notes ---|---|--- `anthropic`| `claude-haiku-4-5-20251001`| Anthropic API. `azure_foundry`| `gpt-5-nano`| Azure AI Foundry API. `azure_openai`| `gpt-5-nano`| Self-hosted Azure OpenAI API. Recommended model version is _2025-08-07_. `aws_anthropic`| `us.anthropic.claude-haiku-4-5-20251001-v1:0`| Serverless Amazon Bedrock API. `aws_meta`| `us.meta.llama4-maverick-17b-instruct-v1:0`| Serverless Amazon Bedrock API. `deepseek`| `deepseek-reasoner`| DeepSeek Platform. `github`| `gpt-4o-mini`| GitHub Models API. `google`| `gemini-3.1-flash-lite-preview`| Google AI Studio API. `mistralai`| `mistral-medium-2505`| Mistral AI Studio API. `ollama`| `mistral-small3.1:24b`| Local model inference with Ollama. `openai`| `gpt-5-nano-2025-08-07`| OpenAI API. `xai`| `grok-4-1-fast-reasoning`| xAI API. You can also override the LLM for each provider by passing it after `/`. ```bash export ALUMNIUM_MODEL="openai/gpt-5" ``` ### `ALUMNIUM_MODEL_TIMEOUT` Timeout in seconds for AI model requests. Default is `90`. ### `ALUMNIUM_OLLAMA_URL` Sets the URL for Ollama models if you host them externally on a server. ### `ALUMNIUM_PLANNER` Set to `false` to disable the planning step. When disabled, the actor’s own reasoning is used as the explanation. Default is `true`. ### `ALUMNIUM_PLAYWRIGHT_HEADLESS` Set to `false` to start Playwright in headed mode. Only used in the MCP server. Default is `true`. ### `ALUMNIUM_PLAYWRIGHT_NEW_TAB_TIMEOUT` Timeout in milliseconds when waiting for a new tab to open after interacting with elements using Playwright driver. Increase when Alumnium fails to detect a new tab. Default is 200. ### `AZURE_FOUNDRY_API_KEY` API key used when `ALUMNIUM_MODEL` is set to `azure_foundry`. ### `AZURE_FOUNDRY_API_VERSION` API version used when `ALUMNIUM_MODEL` is set to `azure_foundry`. ``` -------------------------------- ### Python Test Failure Output Source: https://alumnium.ai/docs/writing-first-test/playwright Example output showing a test failure due to an incorrect assertion. The output highlights the expected vs. received values, indicating that the 'chemical symbol' retrieved was 'Hg' instead of the expected 'Al'. ```bash $ pytest --quiet --headed ... E AssertionError: assert 'Hg' == 'Al' E E - Al E + Hg ... 1 failed in 49.14s ``` -------------------------------- ### Configure Anthropic AI Provider Source: https://alumnium.ai/docs/getting-started/configuration Set the ALUMNIUM_MODEL to 'anthropic' and provide your Anthropic API key. ```bash export ALUMNIUM_MODEL="anthropic" export ANTHROPIC_API_KEY="sk-ant-..." ``` -------------------------------- ### Configure DeepSeek AI Provider Source: https://alumnium.ai/docs/getting-started/configuration Set the ALUMNIUM_MODEL to 'deepseek' and provide your DeepSeek API key. ```bash export ALUMNIUM_MODEL="deepseek" export DEEPSEEK_API_KEY="sk-..." ``` -------------------------------- ### Python Test with Multiple Verifications (Failing) Source: https://alumnium.ai/docs/writing-first-test/playwright This Python test includes multiple checks: verifying the page title contains 'Aluminium', then 'Mercury', and finally asserting that search results do not contain Wikipedia articles. This setup is designed to fail on the Wikipedia check. ```python from alumnium import Alumni from playwright.sync_api import Page from pytest import fixture @fixture def al(page: Page): al = Alumni(page) yield al al.quit() def test_search(al: Alumni, page: Page): page.goto("https://duckduckgo.com") al.do("search for 'Mercury element' and press Enter") al.check("page title contains Aluminium word") al.check("page title contains Mercury word") al.check("search results do not contain Wikipedia articles") ``` -------------------------------- ### Configure local Ollama model inference Source: https://alumnium.ai/docs/guides/self-hosting Pull the required model and set the environment variable to enable Ollama support. ```bash ollama pull mistral-small3.1:24b export ALUMNIUM_MODEL="ollama" ``` -------------------------------- ### Configure Azure OpenAI environment variables Source: https://alumnium.ai/docs/guides/self-hosting Set these variables to connect Alumnium to a deployed model on the Azure OpenAI service. ```bash export ALUMNIUM_MODEL="azure_openai" export AZURE_OPENAI_API_KEY="..." # Change as needed export AZURE_OPENAI_API_VERSION="2025-03-01-preview" export AZURE_OPENAI_ENDPOINT="https://my-model.openai.azure.com" ``` -------------------------------- ### Initial Python Test Verification Source: https://alumnium.ai/docs/getting-started/writing-first-test Sets up a basic test case using pytest fixtures to verify the page title. ```python from alumnium import Alumni from selenium.webdriver import Chrome from pytest import fixture @fixture def driver(): driver = Chrome() yield driver driver.quit() @fixture def al(driver: Chrome): al = Alumni(driver) yield al al.quit() def test_search(al: Alumni, driver: Chrome): driver.get("https://duckduckgo.com") al.do("search for 'Mercury element' and press Enter") al.check("page title contains Aluminium word") ```