Window Size - Max,Min, Webelement Size

 

Window Size :


driver.manage().window().maximize(); Thread.sleep(5000);

driver.manage().window().fullscreen(); Thread.sleep(5000);

driver.manage().window().minimize(); Thread.sleep(5000);

driver.manage().window().maximize();


Get the field Size , height and widht of the element

Dimension dim = new Dimension (414,700);

driver.manage().window().setSize(dim);

//#APjFqb

driver.get("https://www.google.com/");

WebElement searchbutton = driver.findElement(By.cssSelector("#APjFqb"));

System.out.println(searchbutton.getSize());

System.out.println(searchbutton.getSize().getHeight());

System.out.println(searchbutton.getSize().getWidth());

System.out.println(searchbutton.getLocation());


Get Element Colour and font size :



//BackGroup colours:

driver.get("https://naveenautomationlabs.com/opencart/index.php?route=account/register");

WebElement Submit = driver.findElement(By.xpath("//input[@value='Continue']"));

System.out.println(Submit.getCssValue("background-color"));

//

//border-color

System.out.println(Submit.getCssValue("border-color"));

Comments

Popular posts from this blog

Implicit and Explicit Waits,FluentWait,PageLoadTimeOut

A Interview Questions- selenium