Clear Fields and Get Inner HTML
locator.clear() clears the contents of an input field. locator.innerHTML() returns the inner HTML markup of an element.
Task:
- Navigate to
https://testkru.com/Elements/TextFields - Get the pre-filled field (ID:
preFilledTextField) - Print its value
- Clear the field
- Print its value after clearing
- Get the
innerHTMLof the page headingh2
Expected output:
Before clear: Codekru After clear: Heading HTML: Text Fields
TestKru