# Using a Logged-In Browser State for Autonomous Runs

## How to capture and reuse an authenticated browser session for autonomous flows in Donobu.

When you need Donobu to run tests or flows that require an authenticated session, you can reuse the browser state captured during a manual login. Follow these steps to record your login flow, extract its ID, and use it to initialize browser state in autonomous mode.

#### **Prerequisites**

- A valid user account on the target website.
- Basic familiarity with manual and autonomous modes in Donobu Studio.

#### 1. **Creating Your First Flow**

- **Open Manual Mode:** Launch Donobu Studio and select **Manual**.
- **Start Flow:** Enter the URL of the site you want to log into and click **Start Manual**.
- **Record Login:**
  1. Navigate to the site's login page.
  2. Enter **username** and **password**, then submit.
  3. Complete any **2-factor authentication** or **CAPTCHA** prompts.
- **Verify Authentication:** Ensure you're logged in (e.g., profile icon appears).
- **Stop Recording:** Press the stop button or close browser to end the flow once authenticated.

#### 2. **Copy the Flow ID**

- Copy the **Flow ID** of the manual flow

> **Example ID:** `5f8d3b44-1a2c-4eb7-9f24-6a98c0d3d6fe`

#### 3. **Initialize Browser State (Autonomous Mode)**

- Switch to **Autonomous** mode in Donobu Studio.
- Under **Options**:
  1. Set **Initialize browser state from:** to **Flow ID**.
  2. Paste the copied Flow ID.
- Add objective for the autonomous flow.

The flow will now launch with your logged-in session loaded.

#### 4. **Verify and Run**

- **Trigger** the autonomous flow.
- Observe Donobu restoring your logged-in session and executing steps without requiring login.

* * *

#### **Quick Recap**

1. Record login flow (include 2FA/CAPTCHA).
2. Copy the Flow ID.
3. Initialize browser state in Autonomous mode using Flow ID.
4. Run - Donobu reuses the logged-in session.

By following these steps, you can securely reuse authenticated sessions and streamline your tests without exposing credentials in scripts.
