sendkeys

The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)

主宰稳场 提交于 2019-11-26 17:02:23
问题 I am trying to send a String to the sendkeys() method, but it is not accepting and throwing an error as my codes follows: package healthcare; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.Select; import com.thoughtworks.selenium.Selenium; import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium; public class MailRegister

C# Simulate Key Press

南楼画角 提交于 2019-11-26 16:57:00
问题 I was looking for a way to simulate pressing the right Ctrl key in C#, it must be the right one. I know this can be done for the left one but I couldn't find anything on the right one. It is so I can simulate the key press for the manually triggered bsod. Thanks 回答1: You can use keybd_event event to simulate right Ctrl key press. [DllImport("user32.dll", SetLastError = true)] static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo); public const int KEYEVENTF

SendKeys for Python 3.1 on Windows

[亡魂溺海] 提交于 2019-11-26 16:38:40
问题 The latest Python Sendkeys module is for Python 2.6. I can't upgrade it myself as it needs the C module to be recompiled. Does anyone know of a fairly easy alternative way to send keys to a window? Using win32ui.FindWindow() I can find the right window, then make it active with PyCWnd.SetActiveWindow(), so all that's needed is a simple way to send keystrokes to the active window. The purpose is to execute a menu item. The app was written in Delphi, and doesn't have any inter-process interface

Is there a sendKey for Mac in Python?

末鹿安然 提交于 2019-11-26 16:01:04
问题 In Mac 10.6, I want to cause an active application to become de-active, or minimized by Python I know I could use sendKey in Windows with Python, then what about in Mac? 回答1: Here is what I found from a different question on Stack Overflow. It works pretty good for my problem. import os cmd = """ osascript -e 'tell application "System Events" to keystroke "m" using {command down}' """ # minimize active window os.system(cmd) 回答2: Try appscript, an Apple event bridge available in PyPI: from

Send some keys to inactive window with python

自作多情 提交于 2019-11-26 14:30:06
问题 I'm tryin to send some keys to inactive window/process/programm (win32/64) using python. Already read about pywinauto and SendKeys, but both of them activate window before sendin keys. Is there any way to work with inactive window without activate it? It would be great if someone post simple example/snippet. Thanks. 回答1: This is a really old post but there has not been an answer here, I was looking for something exactly like this, and I had spend 6 hours going through Stackoverflow, and ended

Sending Windows key using SendKeys

独自空忆成欢 提交于 2019-11-26 12:28:49
问题 I am working on shortcuts in C#. I succeed implementing Ctrl, Alt and Shift with SendKeys. Like this; Ctrl + C : System.Windows.Forms.SendKeys.SendWait(\"^c\"); or Alt + F4 : System.Windows.Forms.SendKeys.SendWait(\"%{F4}\"); But I can\'t send \"Windows Key\" with SendKeys. I tried ex: Win + E : .SendWait(\"#e\") but it\'s not working. What should I use instead of \"#\"? Thanks. 回答1: OK turns out what you really want is this: http://inputsimulator.codeplex.com/ Which has done all the hard

C# using Sendkey function to send a key to another application

霸气de小男生 提交于 2019-11-26 10:32:44
I want to send a specific key (e.g. k) to another program named notepad, and below is the code that I used: void sendkey () { [DllImport ("User32.dll")] static extern int SetForegroundWindow(IntPtr point); Process p = Process.GetProcessesByName("notepad")[0]; IntPtr pointer = p.Handle; SetForegroundWindow(pointer); SendKeys.Send("k"); } But the code doesn't work, what's wrong with the code? Edited: Is it possible that I send the "K" to the notepad without notepad to be the active window? (e.g. active window = "Google chrome", notepad is in the backgound, which means sending a key to a

How do I send key strokes to a window without having to activate it using Windows API?

冷暖自知 提交于 2019-11-26 05:22:47
I have made an application already that sends commands to an activated window. I want to be able to use the computer while my process is running because as soon as I switch focus to another window the key strokes being sent via send keys will go to the window I just switched to. Currently I use FindWindow, IsIconic, and ShowWindow from the Windows API. I have to check to see if the window is there with FindWindow and set my object to the specific window that is returned with that call, I then check if it's minimized with IsIconic and call ShowWindow if it is, and then finally I have to call

C# using Sendkey function to send a key to another application

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 01:59:29
问题 I want to send a specific key (e.g. k) to another program named notepad, and below is the code that I used: void sendkey () { [DllImport (\"User32.dll\")] static extern int SetForegroundWindow(IntPtr point); Process p = Process.GetProcessesByName(\"notepad\")[0]; IntPtr pointer = p.Handle; SetForegroundWindow(pointer); SendKeys.Send(\"k\"); } But the code doesn\'t work, what\'s wrong with the code? Edited: Is it possible that I send the \"K\" to the notepad without notepad to be the active

How do I send key strokes to a window without having to activate it using Windows API?

微笑、不失礼 提交于 2019-11-26 01:54:22
问题 I have made an application already that sends commands to an activated window. I want to be able to use the computer while my process is running because as soon as I switch focus to another window the key strokes being sent via send keys will go to the window I just switched to. Currently I use FindWindow, IsIconic, and ShowWindow from the Windows API. I have to check to see if the window is there with FindWindow and set my object to the specific window that is returned with that call, I then