Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix frame missing from webelement type #232

Merged
merged 3 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ async def target_1_handler(target):

async def target_2_handler(target):
await target.get("about:blank")
await target.execute_script(script=read("/files/js/show_mousemove.js"))
await target.execute_script(await script=read("/files/js/show_mousemove.js"))
kaliiiiiiiiii marked this conversation as resolved.
Show resolved Hide resolved
await target.pointer.move_to(500, 500, total_time=2)


Expand Down Expand Up @@ -224,7 +224,8 @@ move_kwargs = {"total_time": 0.7, "accel": 2, "smooth_soft": 20}
await pointer.move_to(100, 500)
await pointer.click(500, 50, move_kwargs=move_kwargs, move_to=True)
```
### Iframes
### Iframes / Frames
due `swtich_to.frame()` is deprecated, use this instead

```python
iframes = await driver.find_elements(By.TAG_NAME, "iframe")
Expand Down
2 changes: 1 addition & 1 deletion src/selenium_driverless/types/webelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ async def content_document(self):
**async** gets the document of the iframe
"""
_desc = await self._describe()
if _desc.get("localName") == "iframe":
if _desc.get("localName") in ["iframe","frame"]:
node = _desc.get("contentDocument")
if node:
frame_id = _desc.get("frameId")
Expand Down