Skip to content

[Bug]: Type Text Issue -- Low-priority #320

@mehwishh247

Description

@mehwishh247

Checklist before reporting

  • I have searched for similar issues and didn't find a duplicate.
  • I have updated to the latest version of pydoll to verify the issue still exists.

pydoll Version

2.12.4

Python Version

3.12

Operating System

Linux

Bug Description

When I use type_text feature on input field, it jumbles up characters after a certain number of characters are written. The cursor keeps moving back after typing 22 characters. So whatever you write afterwards, it gets written backwards.
The bug is persistent even after using different cursor speeds.

Steps to Reproduce

  1. Import library using pydoll
  2. Setup browser with Chrome
  3. Run the Chrome in headed mode
  4. Find a field or element where you can enter text such as input fields (Email, URLs, simple text) and store it in a variable, e.g.,

tag = tab.find(tag_name='tag_name')

  1. Use type_text method on the variable, e.g.,
tag.type_text(
     'Some text',
     interval=0.2
     )

or


for i, char in enumerate(TEXT):
        await email.type_text(char, interval=0.2)

  1. Run the program and see the error

Code Example

import pydoll
import asyncio

TEXT = 'Some text to try out'

options = ChromiumOptions()

async with Chrome(options=options) as browser:
    tab = await browser.start()
    await tab.enable_network_events()
    await tab.go_to(BASE_URL)

    text_input = await tab.find(id="text_field")
    await text_input.click(
        x_offset=1,
        y_offset=2
    )
    await asyncio.sleep(2)

    for i, char in enumerate(TEXT):
        await text_input.type_text(char, interval=0.2)  # will run but characters will jumble from end

    await text_input.type_text(TEXT, interval=0.2)   # Same issue. With high cursor speed, it omits the first characters sometimes too

Expected Behavior

If I want to type some text, it shouldn't get jumbled up after a certain number of characters

Actual Behavior

If you use a variable with value "[email protected]', it types '[email protected]'

Relevant Log Output

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions