@@ -843,11 +843,12 @@ def clear(self, locator: LocatorAlias, *args, **kwargs) -> None:
843
843
def is_selected (self , * args , ** kwargs ) -> bool :
844
844
return self .element (* args , ** kwargs ).is_selected ()
845
845
846
- def send_keys (self , text : str , locator : LocatorAlias , * args , ** kwargs ) -> None :
846
+ def send_keys (self , text : str , locator : LocatorAlias , sensitive = False , * args , ** kwargs ) -> None :
847
847
"""Sends keys to the element. Detects the file inputs automatically.
848
848
849
849
Args:
850
850
text: Text to be inserted to the element.
851
+ sensitive: Bool, If is set to True do not log sensitive data.
851
852
*args: See :py:meth:`elements`
852
853
**kwargs: See :py:meth:`elements`
853
854
"""
@@ -864,7 +865,7 @@ def send_keys(self, text: str, locator: LocatorAlias, *args, **kwargs) -> None:
864
865
self .selenium .file_detector = LocalFileDetector ()
865
866
el = self .move_to_element (locator , * args , ** kwargs )
866
867
self .plugin .before_keyboard_input (el , text )
867
- self .logger .debug ("send_keys %r to %r" , text , locator )
868
+ self .logger .debug ("send_keys %r to %r" , "*" * len ( text ) if sensitive else text , locator )
868
869
result = el .send_keys (text )
869
870
if Keys .ENTER not in text :
870
871
try :
0 commit comments