0

I want to take screenshots of all the related search results suggestions based on the keyword entered but one after another, ho do i do this in 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();

1 Answers1

0

You need to use Ashot Api in selenium to take entire page screenshot.

How to take full page Screenshot of a scrollable webpage using Selenium WebDriver with Java? this link will help to resolve this

Justin Lambert
  • 940
  • 1
  • 7
  • 13
  • i dont want to take entire page screenshot, for ex i have entered some keyword into searchbar and the results or suggestion coming out i want to take screenshot of those suggestions but not at once but one after another – Kajol Gupta Jul 17 '20 at 11:02
  • You can do this on ashot Api please try this (there is option to scroll screen) – Justin Lambert Jul 17 '20 at 11:06