simulate

Simulate click on GMail div button with JS

那年仲夏 提交于 2019-12-05 06:38:39
I want to simulate click on GMail COMPOSE button using JS without JQuery. Here is button: <div class="T-I J-J5-Ji T-I-KE L3" role="button" tabindex="0" gh="cm" style="-webkit-user-select: none;">COMPOSE</div> Here is my js: var element = document.getElementsByClassName('T-I-KE')[0]; element.click(); Result: undefined in all browsers Image: http://i.imgur.com/4IX9DZX.png Already tried that: var event = document.createEvent("MouseEvent"); event.initEvent("click",true,true); var element=document.getElementsByClassName("T-I-KE")[0]; element.dispatchEvent(event); Result: true . But nothing happens.

Simulate mouse clicks at a certain position on inactive window in Java?

ぃ、小莉子 提交于 2019-12-05 02:05:02
问题 Anyways, I'm building a bot to run in the background. This bot requires me to click. Of course, I want to be able to do other things while the bot is running. So I was wondering if it was possible for me to simulate a mouse click at a certain position on an inactive window. If this is possible, I would greatly appreciate it if any of you could help me. 回答1: java.awt.Robot Clicking into an active window is going to activate it, though. 来源: https://stackoverflow.com/questions/6497825/simulate

Android: Possible to connect bluetooth to self?

做~自己de王妃 提交于 2019-12-04 20:31:08
At the beginning of this year, I tried to implement an android-app which could stream ALL system-audio to a remote system. This was not easy because (at that time) there was no way to get all system-audio. So I developed a kernel-module which hijacked the audio. But it was a bit buggy and hard to release. So I stopped work on it. But now, some months later I wonder if it is possible to: Connect via bluetooth to myself (= simulate bluetooth), because then I can forward system-audio to it via API and then fetch it on the other side. Anyone an idea? domsom I doubt it. For a couple of reasons

Simulate Key Press at hardware level - Windows

笑着哭i 提交于 2019-12-04 18:52:47
问题 I'm looking for a language or library to allow me to simulate key strokes at the maximum level possible, without physically pressing the key. (My specific measure of the level of the keystroke is whether or not it will produce the same output as a physical Key Press when my computer is already running key listeners (such as MouseKeys and StickyKeys)). I've tried many methods of keystroke emulation; The java AWT library, Java win32api, python win32com sendKeys, python ctypes Key press, and

Simulate Mouse move/click/keyPress in an application that is not active

左心房为你撑大大i 提交于 2019-12-04 14:38:51
问题 I know how to simulate mouse and keyboard events, but they act as if the user did them, so they will affect the window that is active. What I need is to simulate one of those inputs, but in a Window that is not active. I'm not saying that it is minimized, imagine for example, you have msPaint, and notepad. Notepad is in front of paint. And you want to simulate mouse clicks in certain coordinates of the paint window, but without setting it active, making it possible for the user to keep using

JavaScript : Simulate Key Events into Textbox/Input

拜拜、爱过 提交于 2019-12-04 10:49:41
问题 Despite many article on SO on how to simulate key presses (keydown/keypress) in JS, no one solution seems to be working with the browsers I'm using (Firefox ESR 17.0.7, Chrome 28.0.1500.72, IE 10). The solutions I have tested were taken from here, here, and here. What I'm trying to do is to simulate ANY keystroke in a textarea / input. While I can append / delete characters directly changing "value", I see no option but input simulation for the keys like "Up", "Down", "Home", and some others.

How can I simulate a “locked” file (one which has a write lock)

眉间皱痕 提交于 2019-12-04 09:02:50
问题 I am trying to debug a problem where users occasionally have locked files which they try to open. The code appears to have correct exception handling but users are still reporting seeing error messages. How can I simulate a locked file so that I can debug this myself? EDIT: For Windows. 回答1: depends, but in case, MS word locks if you are wonderig if your application lock files and it do not relase locks: just modify a bit your aplication (to create a testapp) and never close the file (and

Help: Maximum number of clients reached - Segmentation fault

安稳与你 提交于 2019-12-04 08:01:14
I want to simulate many key press events. I found a solution by using XTestFakeKeyEvent , but when I simulate more than 210 times my program raises a "Maximum number of clients reached" segmentation fault. I don't known how to solve this problem. My code here: #include <X11/Xlib.h> #include <X11/keysym.h> #include <X11/extensions/XTest.h> #include <stdio.h> #define PRESS_UP 0 #define PRESS_DOWN 1 #define PRESS_LEFT 2 #define PRESS_RIGHT 3 #define PRESS_ENTER 4 #define PRESS_ESC 5 #define PRESS_HOME 6 Display *display; unsigned int keycode; int press(int key){ display = XOpenDisplay(NULL); if

C# Stress Test - Simulate multiple access to a given shared resource

僤鯓⒐⒋嵵緔 提交于 2019-12-04 05:22:57
How can you simulate/stress test about 100 users accessing a given shared resource (e.g. Database) in a c# unit test? Assuming you're accessing real DB you're in the scope of integration tests. The simplest way is to access the resource from multiple threads. For example: [Test] public void SimpleStressTest() { bool wasExceptionThrown = false; var threads = new Thread[100]; for(int i = 0; i < 100; i++) { threads[i] = new Thread(new ThreadStart((Action)(() => { try { AccessDB(); } catch(Exception) { wasExceptionThrown = true; } }))); } for(int i = 0; i < 100; i++) { threads[i].Start(); } for

Sending mouse or touch events to VirtualBox VM from host shell?

三世轮回 提交于 2019-12-04 04:48:11
问题 I know how to send keyboard events (keystrokes) to a VirtualBox Virtual Machine, using VBoxManage controlvm keyboardputscancode <scancode> <scancode> <etc...> Is there a similar way to simulate mouse or touch events ? For example, move the mouse to a certain coordinate or over a certain distance, or send a mouse click, or send a touch/tap on a given coordinate? 回答1: You can do this using Python from vboxapi import VirtualBoxManager mgr = VirtualBoxManager(None, None) vbox = mgr.getVirtualBox(