dalekjs / dalek

[unmaintained] DalekJS Base framework
MIT License
695 stars 63 forks source link

Browser Chrome: clearing an inputField with type() doesn't work #111

Open 5worx opened 10 years ago

5worx commented 10 years ago

Hi,

I'm testing with Chrome and all works fine. But there is an little issue. I filled in a form with .type(). There is an email-confirmationfield. My test is first type different email-addresses than check for errormessage, than clear the confirmation field with .type({selector}, '').

This works with PhantomJS-Browser but not in Chrome.

jheimbach commented 10 years ago

Hi,

.type is adding the given value to the value in a input. if you want to clear the input before you type a new value in, you need to use setValue.

The only difference between these two actions is that setValue is clearing the input before adds the new value.

Unfortunately the setValue actions is broken in the current driver-release, you need to use the canary version of the native driver.

asciidisco commented 10 years ago

We will add the .clear() method from the Webdriver spec in the next version of Dalek, giving you the power of clearing fields before adding new stuff to them.