-
Notifications
You must be signed in to change notification settings - Fork 1.4k
send_keys_slowly() #1249
-
Hi,
First of all Thanks for great package. It takes selenium adoption to next level. :)
To test autocomplete features ( entry fields, searching in dropdown list), we have to send input char-by-char.
It would be nice to implement send_keys_slowly() as a wrapper to send_keys() with time_interval param.
Normally, Iam doing as below now.
def send_keys_slowly(self, element, text, time_interval = '0.02'):
for onechar in text:
element.send_keys( onechar)
self.sleep( time_interval)
self.send_keys_slowly( self.find_element( "#input_field"), 'search param'))
P.S. 'element' can be locator etc as in send_keys().
Thanks,
Bhaskar
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
I think it would be easier to do the following then adding a whole new method for it:
from seleniumbase import BaseCase class DemoSiteTests(BaseCase): def test_demo_site(self): self.open("https://seleniumbase.io/demo_page") for key in "This is Automated": self.add_text("#myTextInput", key) self.sleep(0.1)
Beta Was this translation helpful? Give feedback.
All reactions
-
Makes sense. Thanks a lot. :)
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1