package gooGle;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Zoom_In_Out {
static WebDriver driver;
public static void main(String[] args) throws InterruptedException {
driver=new FirefoxDriver();
driver.get("http://www.google.com");
Thread.sleep(1000);
WebElement html = driver.findElement(By.tagName("html"));
//Zoom in
html.sendKeys(Keys.chord(Keys.CONTROL,Keys.ADD));
System.out.println("zooming in");
Thread.sleep(1000);
//Zoom out
html.sendKeys(Keys.chord(Keys.CONTROL,Keys.SUBTRACT));
Thread.sleep(1000);
System.out.println("zooming out");
}
}
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Zoom_In_Out {
static WebDriver driver;
public static void main(String[] args) throws InterruptedException {
driver=new FirefoxDriver();
driver.get("http://www.google.com");
Thread.sleep(1000);
WebElement html = driver.findElement(By.tagName("html"));
//Zoom in
html.sendKeys(Keys.chord(Keys.CONTROL,Keys.ADD));
System.out.println("zooming in");
Thread.sleep(1000);
//Zoom out
html.sendKeys(Keys.chord(Keys.CONTROL,Keys.SUBTRACT));
Thread.sleep(1000);
System.out.println("zooming out");
}
}
No comments:
Post a Comment