Skip to content

get_attribute() doesn't return value of input #510

@akozyreva

Description

@akozyreva

Hi!
Trying to get value of input and get an error

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=False)
    page = browser.new_page()

    page.goto("https://github.com/", wait_until='networkidle', timeout=30000)
    page.fill("//input[@type='text']", "testing")
    page.wait_for_timeout(5000)
    val = page.get_attribute("//input[@type='text']", "value")
    assert val == "testing"
    browser.close()

Actual value is empty

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions