Commit Graph

1437 Commits

Author SHA1 Message Date
Magnus Müller c69dd517ce Do not download images 2025-10-29 12:45:41 -07:00
reformedot b2b5a260db fix: fixed cubic issues + handle onTabClosed event emission correctly 2025-10-28 18:57:25 -07:00
Aitor 5682f4a993 Merge branch 'main' into feat/improve-session-manager 2025-10-29 02:27:23 +01:00
reformedot 9a0bad39c2 fix: improved session recovery, target type caching & cleaned code 2025-10-28 17:35:04 -07:00
Magnus Müller 00b11e1e27 Add method to retrieve target ID from CDP session ID and enhance DownloadsWatchdog with global network response handling
- Introduced `get_target_id_from_session_id` method in `BrowserSession` to facilitate lookup of target IDs from CDP session IDs.
- Updated `DownloadsWatchdog` to register a global network response callback, improving detection of downloadable content.
- Enhanced error handling and logging for network response events to ensure better tracking of downloads and potential issues.

These changes aim to improve the reliability and functionality of session management and download monitoring in the browser automation framework.
2025-10-27 22:30:53 -07:00
Magnus Müller d4f9f9f072 Linter 2025-10-27 22:21:34 -07:00
Magnus Müller 2e6db8a135 Improve auto download for inside iframe 2025-10-27 21:46:34 -07:00
Magnus Müller 367cae2195 Merge branch 'main' into fix/increase-interaction-timeouts 2025-10-27 18:36:23 -07:00
Magnus Müller 12caa635b9 Increase interaction timeouts to reduce failures on slow pages
Increased timeouts in DefaultActionWatchdog to handle slow-loading
SPAs and dynamic content more reliably:

- Click element fallback: 3.0s → 10.0s (line 126)
- Mouse press event: 1.0s → 3.0s (line 496)
- Mouse release event: 3.0s → 5.0s (line 516)

Analysis of 15,639 benchmark tests showed 1,262 failures (8.1%) due
to input timeouts. This change is expected to resolve ~900 of those
failures, improving overall pass rate from 66.3% to ~72%.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 18:21:18 -07:00
Magnus Müller 3ce813ff2c Merge branch 'main' into test-screenshot 2025-10-27 17:34:03 -07:00
Alezander9 195f1f1f0f address cubic comments 2025-10-27 12:28:06 -07:00
Magnus Müller 4258546098 Add DOM serializer test templates and improve logging
- Introduced new HTML templates for DOM serializer tests, including a main page and an iframe template.
- Enhanced logging in the BrowserSession to provide clearer insights when fetching the CDP client for target nodes, improving traceability during debugging.
- Updated tests to utilize the new HTML templates, ensuring better structure and maintainability.

This update aims to enhance the robustness of the DOM serializer tests and improve error handling in session management.
2025-10-26 22:44:42 -07:00
Magnus Müller 06d0efc289 Improve logging for CDP client retrieval in BrowserSession
- Enhanced error handling when fetching the CDP client for a target node.
- Updated log message to include a warning with the last four characters of the target ID for better traceability.
- Ensured fallback to the main session is clearly indicated in the logs.

This change aims to provide clearer insights during debugging and improve the robustness of the session management.
2025-10-26 22:26:26 -07:00
reformedot f0469a8427 fix: fixed "No active exception to reraise" error 2025-10-26 12:15:22 -07:00
reformedot 3a21ce805d fix: don't focus when generating DOMTree in _get_viewport_ratio 2025-10-26 06:42:10 -07:00
reformedot 54e4dacbf9 feat: improved session manager 2025-10-26 06:05:49 -07:00
Gregor Žunič a3c6fd8025 changed browser use api key creation url everywhere 2025-10-25 10:38:10 -07:00
Magnus Müller cc250ff87e Add element lookup helper methods to BrowserSession
Added two convenience methods for finding element indices:
- get_index_by_id: Find element by its id attribute
- get_index_by_class: Find element by class name

These methods simplify common DOM element lookup patterns when
working with selector maps.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 19:26:55 -07:00
Magnus Müller f41da2d3b4 Fix dropdown selection for Vue.js and reactive frameworks (#3415)
Fixes dropdown selections not persisting in Vue.js, React, and other
reactive frameworks. The issue was that only 'change' events were
dispatched, but Vue's v-model requires 'input' events to register changes.

**Root Cause:**
Dropdown selection handler only dispatched 'change' events, missing the
'input' event required by reactive frameworks.

**Solution:**
Enhanced event dispatching sequence in default_action_watchdog.py:
1. Focus element first
2. Set value and selected state
3. Dispatch 'input' event (critical for Vue v-model and React)
4. Dispatch 'change' event (standard for select elements)
5. Blur element for validation

**Tests:**
Added comprehensive integration tests in tests/ci/interaction/:
- test_dropdown_vue_submit.py: Vue.js 3 with v-model
- test_dropdown_react_submit.py: React 18 with controlled components

Both tests verify dropdown selections persist through the reactive
framework's state management and form submission works correctly.

Closes #3415

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 18:54:57 -07:00
kalil0321 a8be91951f Merge branch 'main' into attempt-fix-real-browser 2025-10-24 14:59:01 +02:00
Magnus Müller c4bee3b347 Revert "error-msg-if-chrome-is-running (#3398)"
This reverts commit 739f8410aa, reversing
changes made to 910d5d6767.
2025-10-24 02:37:15 -07:00
Alezander9 112d85c73b address cubic comments of special characters and newlines 2025-10-23 19:20:14 -07:00
Magnus Müller def2c3e172 Fix 2025-10-23 18:49:08 -07:00
kalil0321 038cb6a7d6 Merge branch 'main' into attempt-fix-real-browser 2025-10-24 00:31:37 +02:00
Magnus Müller cb920922ea Implement Chrome instance check in LocalBrowserWatchdog
This update adds functionality to the LocalBrowserWatchdog class to check for running Chrome/Chromium instances before launching a new browser. If any instances are detected, a RuntimeError is raised, providing users with instructions on how to close existing Chrome windows. This ensures exclusive control over Chrome for CDP debugging, preventing potential conflicts during browser automation.
2025-10-23 14:17:49 -07:00
kalil0321 7a98f78f4a Enhance profile copying in BrowserProfile class to include 'Local State' directory 2025-10-23 18:13:02 +02:00
kalil0321 4da80bf15d Refactor Chrome detection logic in BrowserProfile class 2025-10-23 17:24:45 +02:00
kalil0321 d592723be9 Should copy profile only for Chrome 2025-10-23 17:02:05 +02:00
kalil0321 481b1b5f45 Add profile copying to BrowserProfile class 2025-10-23 16:22:58 +02:00
YangQuan f92ae484dc Update URL from localhost to 127.0.0.1
Change both the request URL and the returned CDP URL to 127.0.0.1 to be consistent with the binding of _find_free_port(), thereby avoiding connection issues caused by IPv4/IPv6 resolution differences.
2025-10-22 15:13:38 +08:00
Magnus Müller aa500c9873 Linter 2025-10-21 21:26:10 -07:00
Magnus Müller 699fb347e1 Wait 10s for requests 2025-10-21 21:25:04 -07:00
Magnus Müller b678f27a3e Migration from highlight index to backendnode id 2025-10-21 21:02:28 -07:00
Magnus Müller 9caa248316 Merge code7 branch changes 2025-10-21 18:55:54 -07:00
AndyJado b2d9f91752 new tab in headless respect window size 2025-10-21 11:01:33 +08:00
Sophia Willows f8f2129285 Add debug log 2025-10-21 11:52:47 +13:00
Sophia Willows 1206391e59 Fix framework events not firing correctly 2025-10-21 11:52:06 +13:00
Saurav Panda ee355bf43c Merge branch 'main' into focus-causes-llm-to-not-input-text-properly 2025-10-16 16:59:08 -07:00
Saurav Panda eb6eee149a fix: Wrapped select() in try-catch to handle input types that don't support text selection 2025-10-16 16:42:18 -07:00
Saurav Panda 48e0cbb784 fixed clear issue when focus fails. 2025-10-16 16:10:48 -07:00
Reagan Hsu eaad2c7e63 Merge branch 'main' into fix/keyboard-events-complete 2025-10-15 14:18:34 -07:00
Reagan Hsu 659c0ddf42 make new utils file and add get_key_info 2025-10-15 13:48:08 -07:00
Magnus Müller 4c7cf16042 add get_state_as_text 2025-10-15 11:35:24 -07:00
Reagan Hsu b7ca829032 Apply code style fixes from pre-commit hooks
- Reorganize imports in default_action_watchdog.py
- Remove unused platform import at top level
- Add proper spacing in inline comments
- Reformat function signatures to single line
- Fix import order in play_2048.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-13 19:36:06 -07:00
Reagan Hsu bc0ce8c226 Merge branch 'main' into fix/keyboard-events-complete 2025-10-13 19:29:16 -07:00
Reagan Hsu e1ff1edb93 import syntax 2025-10-13 19:26:17 -07:00
Reagan Hsu 8b3b117d9e fixed cubic errors 2025-10-13 19:15:32 -07:00
Reagan Hsu 81933bb20c update Page.press() to include event code and windowsVirtualKeyCode
removed invalid filter param in attachToTarget()

added more keys and better parsing for lowercase keys using get_key_info() to make sure that key presses are properly processed
2025-10-13 18:34:30 -07:00
Magnus Müller c9e2886e13 wait between actions to 0.1 2025-10-12 17:09:51 -07:00
Magnus Müller f6fa2a42f3 Remove wait after click 2025-10-12 17:01:49 -07:00