Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Cross-browser clear input field #20

Merged
merged 1 commit into from
Jul 21, 2016
Merged

Cross-browser clear input field #20

merged 1 commit into from
Jul 21, 2016

Conversation

txels
Copy link
Contributor

@txels txels commented Jul 21, 2016

This is likely to work well on PhantomJS, Chrome, Firefox... Linux, OSX... tested locally on OSX with all three browsers.

@@ -562,8 +562,7 @@ def write_textfield(id_or_elem, new_text, check=True, clear=True):
# clear field with send_keys(), don't use clear() (see
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to remove the comment about using send_keys() and not clear()?

@andreypanin
Copy link
Contributor

Næs!

@txels txels force-pushed the master-clear-input branch from 1c0aed1 to 6447602 Compare July 21, 2016 11:31
@txels txels force-pushed the master-clear-input branch from 6447602 to c06e7a3 Compare July 21, 2016 11:33
textfield.send_keys(keys.Keys.DELETE)
if textfield.get_attribute('value') != '':
# for when send_keys does not work, e.g. PhantomJS
textfield.clear()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arnlaugsson I've gone for a cowardly non-committal approach.

@arnlaugsson arnlaugsson merged commit 609acdd into master Jul 21, 2016
@arnlaugsson arnlaugsson deleted the master-clear-input branch July 21, 2016 13:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants