# gcuser99/seleniumvba architecture

> Architecture diagram of the GitHub repository gcuser99/seleniumvba, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gcuser99/seleniumvba
- Repository: https://github.com/gcuser99/seleniumvba

## Overview

SeleniumVBA is a Windows browser-automation wrapper for MS Office VBA, also offered as a twinBASIC ActiveX DLL. The primary workflow is to start a browser, open it, navigate to a page, locate an element, and interact with it; the README’s examples show both direct keyboard input and action chains. The graph also preserves documented capabilities for driver updates, browser protocols, DOM features, and browser state. Source excerpts cover only twinBASIC JavaScript helpers, so links to those helpers are omitted where their callers are not shown.

Main entry points: [`src/VBA/WebDriver.cls`](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebDriver.cls) (WebDriver), [`src/VBA/WebElement.cls`](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebElement.cls) (Web element), [`src/VBA/WebDriverManager.cls`](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebDriverManager.cls) (Driver manager), [`src/VBA/WebActionChain.cls`](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebActionChain.cls) (Action chains)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser_control["Browser control"]
  node_webdriver["WebDriver<br/>[WebDriver.cls]"]
  node_driver_manager["Driver manager"]
  node_capabilities["Capabilities"]
end

subgraph group_interaction["Page interaction"]
  node_element["Web element<br/>[WebElement.cls]"]
  node_elements["Element collection<br/>[WebElements.cls]"]
  node_keyboard["Keyboard input<br/>[WebKeyboard.cls]"]
  node_action_chain["Action chains<br/>[WebActionChain.cls]"]
  node_shadow_root["Shadow roots<br/>[WebShadowRoot.cls]"]
  node_script_protocols["Script and CDP<br/>[WebDriver.cls]"]
end

subgraph group_browser_state["Browser state"]
  node_alerts["Browser alerts<br/>[WebAlert.cls]"]
  node_cookies["Cookies<br/>[WebCookies.cls]"]
  node_windows["Windows<br/>[WebWindows.cls]"]
end

subgraph group_internal["Internal helpers"]
  node_json_converter["JSON conversion"]
  node_browser_scripts["Browser-side helpers"]
end

node_user(("VBA user"))
node_browser["Edge, Chrome, Firefox"]
node_driver_download["Driver download"]

node_user -->|"starts browser"| node_webdriver
node_webdriver -->|"opens and navigates"| node_browser
node_webdriver -->|"finds element"| node_element
node_element -->|"sends keys"| node_keyboard
node_user -->|"builds actions"| node_action_chain
node_action_chain -->|"targets element"| node_element
node_webdriver -->|"updates driver"| node_driver_manager
node_driver_manager -->|"downloads driver"| node_driver_download
node_webdriver -->|"configures browser"| node_capabilities

click node_webdriver "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebDriver.cls"
click node_driver_manager "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebDriverManager.cls"
click node_capabilities "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebCapabilities.cls"
click node_element "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebElement.cls"
click node_elements "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebElements.cls"
click node_keyboard "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebKeyboard.cls"
click node_action_chain "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebActionChain.cls"
click node_shadow_root "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebShadowRoot.cls"
click node_alerts "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebAlert.cls"
click node_cookies "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebCookies.cls"
click node_windows "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebWindows.cls"
click node_script_protocols "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebDriver.cls"
click node_json_converter "https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebJsonConverter.cls"
click node_browser_scripts "https://github.com/gcuser99/seleniumvba/tree/main/src/twinBASIC/Resources/SCRIPTS"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webdriver,node_driver_manager,node_capabilities,node_user toneBlue
class node_element,node_elements,node_keyboard,node_action_chain,node_shadow_root,node_script_protocols toneAmber
class node_alerts,node_cookies,node_windows toneMint
class node_json_converter,node_browser_scripts toneRose
class node_browser,node_driver_download toneIndigo
```

## Components

### Browser control

- [WebDriver](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebDriver.cls): `src/VBA/WebDriver.cls`
- [Driver manager](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebDriverManager.cls): `src/VBA/WebDriverManager.cls`
- [Capabilities](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebCapabilities.cls): `src/VBA/WebCapabilities.cls`

### Page interaction

- [Web element](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebElement.cls): `src/VBA/WebElement.cls`
- [Element collection](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebElements.cls): `src/VBA/WebElements.cls`
- [Keyboard input](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebKeyboard.cls): `src/VBA/WebKeyboard.cls`
- [Action chains](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebActionChain.cls): `src/VBA/WebActionChain.cls`
- [Shadow roots](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebShadowRoot.cls): `src/VBA/WebShadowRoot.cls`
- [Script and CDP](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebDriver.cls): `src/VBA/WebDriver.cls`

### Browser state

- [Browser alerts](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebAlert.cls): `src/VBA/WebAlert.cls`
- [Cookies](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebCookies.cls): `src/VBA/WebCookies.cls`
- [Windows](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebWindows.cls): `src/VBA/WebWindows.cls`

### Internal helpers

- [JSON conversion](https://github.com/gcuser99/seleniumvba/blob/main/src/VBA/WebJsonConverter.cls): `src/VBA/WebJsonConverter.cls`
- [Browser-side helpers](https://github.com/gcuser99/seleniumvba/tree/main/src/twinBASIC/Resources/SCRIPTS): `src/twinBASIC/Resources/SCRIPTS`

### Other components

- **VBA user**
- **Edge, Chrome, Firefox**
- **Driver download**

## Connections

- VBA user → WebDriver: starts browser (evidence: `README.md`)
- WebDriver → Edge, Chrome, Firefox: opens and navigates (evidence: `README.md`)
- WebDriver → Web element: finds element (evidence: `README.md`)
- Web element → Keyboard input: sends keys (evidence: `README.md`)
- VBA user → Action chains: builds actions (evidence: `README.md`)
- Action chains → Web element: targets element (evidence: `README.md`)
- WebDriver → Driver manager: updates driver (evidence: `README.md`)
- Driver manager → Driver download: downloads driver (evidence: `README.md`)
- WebDriver → Capabilities: configures browser (evidence: `README.md`)
