如何使用浏览器。
有人知道需要对此代码进行哪些调整才能在Firefox上正确执行?
这是我的测试代码,它可以执行控制 +单击Chrome上的项目。但是,当在Firefox上执行(Geckodriver V0.30.0 Win64)时,测试代码的效果变成单击项目。我检查了doc https://webdriver.io/docs/docs/docs/api/webdriver/webdriver/webdriver/#performions < /a>,但找不到任何线索。
const ctlKey = '\uE009';
browser.performActions([
{
actions: [{ type: 'keyDown', value: ctlKey }],
id: 'press',
type: 'key',
},
]);
// multiple Control + Click.
items.forEach(item => {
item.click();
});
// release
browser.performActions([
{
actions: [{ type: 'keyUp', value: ctlKey }],
id: 'release',
type: 'key',
},
]);
Does anyone know what adjustments need to be made to this code to execute correctly on FireFox?
Here is my test code, it can execute Control + Click items on chrome. But when executed on FireFox(geckodriver v0.30.0 win64), the effect of the test code becomes Click items. I checked the doc https://webdriver.io/docs/api/webdriver/#performactions, but not found any clue.
const ctlKey = '\uE009';
browser.performActions([
{
actions: [{ type: 'keyDown', value: ctlKey }],
id: 'press',
type: 'key',
},
]);
// multiple Control + Click.
items.forEach(item => {
item.click();
});
// release
browser.performActions([
{
actions: [{ type: 'keyUp', value: ctlKey }],
id: 'release',
type: 'key',
},
]);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来Firefox无法以这种方式支持。仅当我使用表演与按下和释放控件一起进行单击时,它才能起作用。
It looks like FireFox can't support this way. It only works when I use performActions to do clicks together with pressing and releasing the Control.