Don't use javascript in webelem.set_text for hints
This commit is contained in:
parent
193c755637
commit
4318604c57
@ -1452,7 +1452,7 @@ class CommandDispatcher:
|
||||
text: The new text to insert.
|
||||
"""
|
||||
try:
|
||||
elem.set_text(text)
|
||||
elem.set_text(text, use_js=True)
|
||||
except webelem.IsNullError:
|
||||
raise cmdexc.CommandError("Element vanished while editing!")
|
||||
|
||||
|
@ -168,10 +168,14 @@ class WebElementWrapper(collections.abc.MutableMapping):
|
||||
self._check_vanished()
|
||||
return self._elem.styleProperty(name, strategy)
|
||||
|
||||
def set_text(self, text):
|
||||
"""Set the given plain text."""
|
||||
def set_text(self, text, *, use_js=False):
|
||||
"""Set the given plain text.
|
||||
|
||||
Args:
|
||||
use_js: Whether to use javascript if the element isn't content-editable.
|
||||
"""
|
||||
self._check_vanished()
|
||||
if self.is_content_editable():
|
||||
if self.is_content_editable() or not use_js:
|
||||
log.misc.debug("Filling element {} via set_text.".format(
|
||||
self.debug_text()))
|
||||
self._elem.setPlainText(text)
|
||||
|
Loading…
Reference in New Issue
Block a user