question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

There should be a method similar to pressKey wich could press multiple keys in sequence

See original GitHub issue

What are you trying to achieve?

Populating text to places which are not text fields or textareas.

What do you get instead?

As I can’t use fillField() to achieve this, in these cases, I end up using multiple lines of pressKey(), or sometimes transforming my string into an array and using a forEach() on it to solve the problem.

I think that a method like pressKeys would be ideal to solve problems like this.

I.pressKeys("My long text here...")

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
DavertMikcommented, Feb 11, 2020

I agree to add another method

I.type('keys')

We are in situation where it’s easier to add a new method to all helpers than update all current helpers to introduce a new behavior. I.type should be the best solution for now as it ca be combined with I.pressKeyDown and I.pressKeyUp.

Any volunteers to implement it?

1reaction
PeterNgTrcommented, Feb 10, 2020

True @PeterNgTr I do think it shouldn’t be called I.pressKeys however, as it could be a bit messy with mod keys, might call it something like I.Type

`pressKey` - Presses a key in the browser (on a focused element).
Hint: For populating text field or textarea, it is recommended to use fillField

Or maybe enhance the fillField method

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to detect if multiple keys are pressed at once using ...
Generally, it'll work with the cases you would realistically want (ctrl, alt, shift), but if you need to hit, say, a+w at the...
Read more >
Using your keyboard - Microsoft Support
In Help topics, a plus sign (+) between two or more keys indicates that those keys should be pressed in combination. For example,...
Read more >
Simulate Keypresses In Python - Nitratine
This demonstrates how to press keys with Python. Using pynput we are able to simulate key presses into any window. This will show...
Read more >
Key rollover - Wikipedia
Key rollover is the ability of a computer keyboard to correctly handle several simultaneous keystrokes. A keyboard with n-key rollover (NKRO) can correctly ......
Read more >
Keyboard Events in Selenium Actions Class - Tools QA
keyDown(): This method simulates a keyboard action when a specific keyboard key needs to press. So, whenever you need to press a key...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found