Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

send_keys_slowly() #1249

pr3z3ntbhaskar started this conversation in Ideas
Mar 13, 2022 · 1 comments · 1 reply
Discussion options

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

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

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)
You must be logged in to vote
1 reply
Comment options

Makes sense. Thanks a lot. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /