在自动化测试的过程中,经常会出现这样的场景:

按住Ctrl的同时,进行单击操作,已达到多选的目的

Actions a = new Actions(driver);
a.keyDown(Keys.CONTROL).perform();
for(int i = 0;i<quantity;i++){
      WebElement securityEl = securitiesList.get(i);
      SeleniumUtil.scrollIntoView(driver, securityEl);
      securityEl.click();
 }
a.keyUp(Keys.CONTROL).perform();

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-28
  • 2022-12-23
  • 2021-09-16
相关资源
相似解决方案