有一个大约200名学生的数据库,我需要从下拉列表中选择2个项目,并在结束时单击保存按钮。手动操作大约需要5-6秒。我想知道是否有可能实现自动化?截图如下:

然后选择2个项目:


最后点击“保存”按钮:

发布于 2018-09-15 15:24:48
在selenium中,你可以这样做:
WebElement mySelectElement = driver.findElement(By.id("id of the dropdown"));
Select dropdown= new Select(mySelectElement);
dropdown.selectByIndex(2);//select it by index
driver.findElement(By.id("id of your button")).click();https://stackoverflow.com/questions/52342386
复制相似问题