Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resize/maximize Firefox window during launching Selenium Remote Control?

Tags:

I am using Selenium Remote Control . During executing the tests the actual Firefox window is so small. I want it full screen so I can see what is happening. How can I maximize the browser screen?

like image 536
chobo2 Avatar asked Oct 05 '09 20:10

chobo2


People also ask

How do I change the size of a window in Selenium?

You need to use resize method to minimize the browser. void setSize() – This method is used to set the size of the current browser. Dimension getSize() – This method is used to get the size of the browser in height and width.

What is the Selenium command to set the browser maximized?

Use the maximize() method from WebDriver. Maximizing the Chrome Window.

Which of the following is used to resize the window in Selenium?

Using Selenium WebDriver we could Resize Browser Window size. It allows resizing and maximizing window natively from its API. To resize browser window to particular dimensions, we use 'Dimension' class to resize the browser window.

How do I maximize my browser window?

To maximize a window, grab the titlebar and drag it to the top of the screen, or just double-click the titlebar. To maximize a window using the keyboard, hold down the Super key and press ↑ , or press Alt + F10 .


1 Answers

Try the windowMaximize command:

selenium.windowMaximize(); 

You can also set a specific width and height using the following command:

selenium.getEval("window.resizeTo(X, Y); window.moveTo(0,0);") 

Where X is the width and Y is the height.

like image 55
Dave Hunt Avatar answered Nov 09 '22 00:11

Dave Hunt