MCPcopy Index your code
hub / github.com/microsoft/playwright-python / fill

Method fill

playwright/async_api/_generated.py:2554–2595  ·  view source on GitHub ↗

ElementHandle.fill This method waits for [actionability](https://playwright.dev/python/docs/actionability) checks, focuses the element, fills it and triggers an `input` event after filling. Note that you can pass an empty string to clear the input field. If the target eleme

(
        self,
        value: str,
        *,
        timeout: typing.Optional[typing.Union[float, datetime.timedelta]] = None,
        no_wait_after: typing.Optional[bool] = None,
        force: typing.Optional[bool] = None,
    )

Source from the content-addressed store, hash-verified

2552 )
2553
2554 async def fill(
2555 self,
2556 value: str,
2557 *,
2558 timeout: typing.Optional[typing.Union[float, datetime.timedelta]] = None,
2559 no_wait_after: typing.Optional[bool] = None,
2560 force: typing.Optional[bool] = None,
2561 ) -> None:
2562 """ElementHandle.fill
2563
2564 This method waits for [actionability](https://playwright.dev/python/docs/actionability) checks, focuses the element, fills it and triggers an
2565 `input` event after filling. Note that you can pass an empty string to clear the input field.
2566
2567 If the target element is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an
2568 error. However, if the element is inside the `<label>` element that has an associated
2569 [control](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), the control will be filled
2570 instead.
2571
2572 To send fine-grained keyboard events, use `locator.press_sequentially()`.
2573
2574 Parameters
2575 ----------
2576 value : str
2577 Value to set for the `<input>`, `<textarea>` or `[contenteditable]` element.
2578 timeout : Union[float, None]
2579 Maximum time in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can
2580 be changed by using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods.
2581 no_wait_after : Union[bool, None]
2582 This option has no effect.
2583 Deprecated: This option has no effect.
2584 force : Union[bool, None]
2585 Whether to bypass the [actionability](../actionability.md) checks. Defaults to `false`.
2586 """
2587
2588 return mapping.from_maybe_impl(
2589 await self._impl_obj.fill(
2590 value=value,
2591 timeout=to_milliseconds(timeout),
2592 noWaitAfter=no_wait_after,
2593 force=force,
2594 )
2595 )
2596
2597 async def select_text(
2598 self,

Callers

nothing calls this directly

Calls 3

to_millisecondsFunction · 0.90
from_maybe_implMethod · 0.80
fillMethod · 0.45

Tested by

no test coverage detected