Skip to content

Commit 73d2cb7

Browse files
committed
fix: using new execute_script public method
1 parent 246bc21 commit 73d2cb7

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

pydoll/elements/web_element.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ async def get_children_elements(
148148
self, max_depth: int = 1, tag_filter: list[str] = []
149149
) -> list['WebElement']:
150150
"""Element's child elements."""
151-
result = await self._execute_script(
151+
result = await self.execute_script(
152152
Scripts.GET_CHILDREN_NODE.format(max_depth=max_depth, tag_filter=tag_filter)
153153
)
154154
if not self._has_object_id_key(result):
@@ -176,7 +176,7 @@ async def get_children_elements(
176176

177177
async def get_siblings_elements(self, tag_filter: list[str] = []) -> list['WebElement']:
178178
"""Element's siblings elements."""
179-
result = await self._execute_script(Scripts.GET_SIBLINGS_NODE.format(tag_filter=tag_filter))
179+
result = await self.execute_script(Scripts.GET_SIBLINGS_NODE.format(tag_filter=tag_filter))
180180
if not self._has_object_id_key(result):
181181
raise ElementNotFound(f'Sibling element not found for element: {self}')
182182

tests/test_web_element.py

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
1+
import asyncio
2+
import json
3+
from pathlib import Path
4+
from unittest.mock import AsyncMock, patch
5+
16
import pytest
27
import pytest_asyncio
3-
from unittest.mock import AsyncMock, MagicMock, patch, mock_open
4-
import json
5-
import asyncio
68

9+
from pydoll.browser.options import ChromiumOptions as Options
10+
from pydoll.browser.chromium.chrome import Chrome
11+
from pydoll.commands import DomCommands, RuntimeCommands
12+
from pydoll.constants import Key
13+
from pydoll.elements.web_element import WebElement
714
from pydoll.exceptions import (
8-
ElementNotVisible,
9-
ElementNotInteractable,
10-
ElementNotFound,
1115
ElementNotAFileInput,
16+
ElementNotFound,
17+
ElementNotInteractable,
18+
ElementNotVisible,
1219
WaitElementTimeout,
1320
)
14-
from pydoll.commands import (
15-
DomCommands,
16-
InputCommands,
17-
PageCommands,
18-
RuntimeCommands,
19-
)
20-
from pydoll.constants import Key
2121
from pydoll.protocol.input.types import KeyModifier
2222

2323

24-
from pydoll.elements.web_element import WebElement
25-
26-
2724
@pytest_asyncio.fixture
2825
async def mock_connection_handler():
2926
"""Mock connection handler for WebElement tests."""
@@ -133,7 +130,6 @@ def ci_chrome_options():
133130
options.add_argument('--disable-backgrounding-occluded-windows')
134131
options.add_argument('--disable-renderer-backgrounding')
135132
options.add_argument('--disable-default-apps')
136-
options.add_argument('--no-default-browser-check')
137133

138134
# Memory optimization
139135
options.add_argument('--memory-pressure-off')

0 commit comments

Comments
 (0)