Tip | Secure type method for input elements

Updated: Feb 17

The problem

When working with selenium, write in elements that are not fully loaded sometimes end up with the text cut.

The solution

Ensuring that elements end with the expected text with a retry method that checks the element final text value.

The code above ensures the input is clear before trying to type, and then retry the sendKeys method until the element has the expected text.

Also the same code for puppeteer

© 2020 Qa lemming