简体   繁体   English

模拟按键和触控板事件守夜

[英]simulate key and trackpad events nightwatch

I need to simulate scrolling using mouse wheel and trackpad. 我需要使用鼠标滚轮和触控板模拟滚动。 Is there any way in which I can do this in nightwatch or javascript?The nightwatch documentation does not have anything mentioned for mousewheel and trackpad.Any guidance in this issue would be of great help :) 我有什么方法可以在守夜人或javascript中做到这一点?守夜人的文档中没有提到鼠标滚轮和触控板的任何内容,对此问题的任何指导都将有很大帮助:)

use window.scrollBy(x,y) 使用window.scrollBy(x,y)

Change x for horizontal and y for vertical scroll increments 将x更改为水平,将y更改为垂直滚动增量

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JavaScript:将关键事件模拟​​到文本框/输入中 - JavaScript : Simulate Key Events into Textbox/Input Javascript - 模拟Chrome 53上的关键事件 - Javascript - simulate key events on Chrome 53 是否可以通过编程方式模拟按键事件? - Is it possible to simulate key press events programmatically? 如何在 CodeMirror 编辑器中使用 selenium 模拟关键事件 - How can I simulate key events with selenium in a CodeMirror Editor 只需在鼠标+触控板上使用快照滚动触发/模拟滑动手势 - Only need snap scroll trigger / simulate swipe gesture on mouse + trackpad 是否可以通过浏览器JavaScript检测Mac上触控板,魔术鼠标或魔术触控板的多点触摸事件? - Is there a way to detect, through browser javascript, multi-touch events of a trackpad, magic mouse or magic trackpad on a mac? 有没有办法在Chrome中的JavaScript和Firefox中获取触控板力事件? - Is there a way to get trackpad force events in JavaScript in Chrome and Firefox? 如何通过 map 移动触摸事件模拟 Javascript 中的上/下按键? - How can I map mobile touch events to simulate key press up/down in Javascript? 如何模拟“焦点”和“打字”事件 - How to simulate an "Focus" and "typing" Events 在自定义事件上使用酶模拟? - Using Enzyme simulate on custom events?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM