我想根据输入的关键字截取所有相关搜索结果建议的屏幕截图,但一个接一个,我如何在selenium中做到这一点??
for(int i=1; i<=sheet.getLastRowNum(); i++) {
//Import data for company names.
cell = sheet.getRow(i).getCell(1);
cell.setCellType(CellType.STRING);
Thread.sleep(3000);
//Here i'm reading and writing inputs from excel sheet
WebElement SearchBar = driver.findElement(By.className("search-global-typeahead__input"));
SearchBar.sendKeys(cell.getStringCellValue(), Keys.ENTER);
Thread.sleep(3000);
wait = new WebDriverWait(driver,30);
SearchBar.submit();发布于 2020-07-17 17:19:02
您需要使用selenium中的Ashot Api来截取整个页面的屏幕截图。
How to take full page Screenshot of a scrollable webpage using Selenium WebDriver with Java?此链接将有助于解决此问题
https://stackoverflow.com/questions/62950841
复制相似问题