Doesn't work key simulation ( send_keys )
See original GitHub issueWinium.Desktop v.1.6.0 Selenium v.3.0.2 Python v.3.4.4
Using examples from Wiki and habrahabr article:
from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Remote(
command_executor='http://localhost:9999',
desired_capabilities={
"debugConnectToRunningApp": 'false',
"app": r"C:/windows/system32/notepad.exe"
})
time.sleep(0.5)
window = driver.find_element_by_class_name('Notepad')
text_field = window.find_element_by_class_name('Edit')
text_field.click()
text_field.send_keys('Some text{ENTER}{ENTER}')
actions = ActionChains(driver)
actions.send_keys('Another text{ENTER}')
actions.send_keys('^{o}')
actions.perform()
ActionChains(driver).key_down(Keys.CONTROL).send_keys('o').key_up(Keys.CONTROL).perform()
ActionChains(driver).key_down('\ue009').send_keys('o').key_up('\ue009').perform()
Result: “Some text{ENTER}{ENTER}Another text{ENTER}^{o}oo” Keys simulation does not work.
Is it bug or i do something wrong? If the second, what exactly wrong?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
Top Results From Across the Web
send_keys() method doesn't work for entering Passcode on ...
1 Answer 1 ... Can you try to click or tap, the individual elements(numbers) instead of using sendKeys, usually you use sendKeys for...
Read more >[Solved] Keyboard simulation does not work for game
Hi I simulated keyboard using c#,this code work fine and send command to IE, Notepad, Crome,but it fail to send command to game...
Read more >How to Use Excel SendKeys Method in Macros
You can use the SendKeys method in your Excel macros VBA code, to simulate keystrokes that you would manually input in the active...
Read more >Selenium SendKeys: A Detailed Usage Guide With Examples
SendKeys is a method used to send keyboard input such as characters ... In such cases, just finding the element and sending keys...
Read more >Selenium SendKeys: A Detailed Usage Guide
Selenium Sendkeys is a method used in Selenium WebDriver to simulate the typing of a keyboard key in a web application.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
By updating below code in KeyboardModifiers.cs class, will allow you to use Enter key Winium.Desktop.Driver\Input\KeyboardModifiers.cs internal class KeyboardModifiers : List<string> { #region Static Fields
Winium.Desktop.Driver\Winium.Desktop-1.6.0\src\Winium.Desktop.Driver\Input\KeyboardModifiers.cs