javascriptseleniumnightwatch

How to clear field using nightwatch framework?


I'm trying to clear input field using different ways:

  1. clearValue() - doesn't work
  2. send some combination ok keys - doesn't work

Solution

  • Have you tried removing the Input with the Webriver-Key commands?

    In my Project i do it like this:

    for (let i = 0; i < amountChars; i++) {
                browser.keys(WEBDRIVER_KEYS['Backspace']);
            }
    

    WEBDRIVER_KEYS is part of the spectron-keys npm package.