How to modify attribute 'value' content in playwright - angular 15

Discussão em 'Angular' iniciado por Kent, Agosto 28, 2025.

  1. Kent

    Kent Guest

    I am wondering if someone could give an idea how to access and change the content of value attribute in the code below.

    <table>
    <thead>
    <tr>...</tr>
    </thead>
    <tbody>
    <tr>...</tr>
    <tr>
    <td>Test</td>
    <td><input type="text" id="id_1" name="test_name_1" value="John"></td>
    <td><input type="text" id="id_2" name="test_n_2" value="Student"></td>
    </tr>
    </tbody>
    </table>


    Verified with: expect(await page.locator('td:has-text("John")')).toBeTruthy();

    How do I change the value in td -> input, that is, value="John" => value="Paul" and value="Student" => value="Teacher"?

    Continue reading...

Compartilhe esta Página