selenium-webdriver - 如何在 Selenium WebDriver 中同时执行 'CTRL + Enter '?

标签 selenium-webdriver

如何在 Selenium WebDriver 中同时执行 Ctrl+Enter↵? 我试过这个:

       body1.sendKeys(Keys.CONTROL + "ENTER");

但它不起作用。

最佳答案

   String keysPressed =  Keys.chord(Keys.CONTROL, Keys.RETURN);
   element.sendKeys(keysPressed) ;

将为您完成工作..

关于selenium-webdriver - 如何在 Selenium WebDriver 中同时执行 'CTRL + Enter '?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18487159/

相关文章:

ruby - 想在多个场景的 Cucumber 特性文件中只执行一次 Background

python - Selenium WD Python 消息 : Invalid timeout type specified: sessionId

python - 使用 selenium 8 进行屏幕抓取

c# - 如何使用 Selenium Web Driver 和 C# 清除浏览器 cookie

java - selenium webdriver 如何为每次运行维护单独的 session ?

java - 我想遍历页面的链接,但我的程序在中间终止而没有抛出任何错误

extjs - 如何在 selenium webdriver 中处理 ExtJS 的组合框

java - 使用 Selenium 和 Chrome 开发工具的浏览器内存泄漏自动化

android - selenium 脚本中的 "The type org.openqa.selenium.remote.http.HttpClient$Factory cannot be resolved."错误消息

javascript - 如何使用selenium webdriver点击链接