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 maximi
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.
Selenium 2.31.0
driver = webdriver.Firefox()
# Resize the window to the screen width/height
driver.set_window_size(300, 500)
# Move the window to position x/y
driver.set_window_position(200, 200)
for Firefox: sel.key_press_native(122) (122 in the key code for F11)
This works for me. All the other solutions didn't work in FF7.
WebDriver driver = ((WebDriverBackedSelenium) selenium).getWrappedDriver();
driver.manage().window().setPosition(new Point(0, 0));
driver.manage().window().setSize(new Dimension(1920, 1080));
To expand on David Hunt's suggestion for more specific window resizing and moving note the following.
To work in most environments move before resizing. That is:
selenium.getEval("window.moveTo(X, Y); window.resizeTo(X, Y); ")
To cover 2/3's of the screen, which is handy for seeing part of the selenium driving window underneath, and to do this regardless of your target screen resolution:
selenium.getEval("window.moveTo(screen.availWidth / 3,0); window.resizeTo(screen.availWidth * (2/3), screen.availHeight); ");
Well I think the best way is to use selenium.windowMaximize() selenium function instead of manipulating the windows size.