Hi!
For this trick we need to initialize a WebDriver and then the following lines:
Dimension dimension = new Dimension(width, height);
driver.manage().window().setSize(dimension);
NOTE: width and height should be int numbers.
You can actually create a separate method, like this:
public void resize(int w, int h)
{
Dimension dimension = new Dimension(w, h);
driver.manage().window().setSize(dimension);
}
Share this article with a friend!
No hay comentarios.:
Publicar un comentario