How can any zoom in and out in a Selenium-based test case in java?

In a java Selenium-based test case, how can one zoom in and out?

Hey Anna,

User need to inject script in javascript console using javascript executor. Take a reference below to zoom in over the element on the web page

  WebElement abc=driver.findElement(By.id("file-submit"));
  JavascriptExecutor js = (JavascriptExecutor) driver;
  js.executeScript("document.body.style.zoom = '200%'",abc);

Example Zoom In: +200% Zoom Out: -200%