How to maximize / minimize Firefox browser window using Selenium Remote Driver in perl scripts

I am using the Selenium :: Remote :: Driver module. I am trying to maximize / minimize the browser window using the perl language. I can set the window size to specific coordinates, but not fully maximized and minimized. So please help me do this. My code is as follows:

maximize.pl

use strict;
use warnings;
use Selenium::Remote::Driver;
my $driver = new Selenium::Remote::Driver;

$driver->get("https://www.google.co.in/");
$driver->set_implicit_wait_timeout(40000);
$driver->set_window_size($driver->screenwidth, $driver->screenheight,'current');

Here I get an error like "Cannot find the object method" Screen Width "through the package" Selenium :: Remote :: Driver "

Can you suggest me how to maximize or minimize the browser window using the remote selenium driver?

code change:

$driver->set_window_size(1920, 1680,'current');

, , 1920 1680 - , , , , - , .

+3
1

, Selenium:: Remote:: Driver , Selenium Perl .

WWW:: Selenium, window_maximize:

use WWW::Selenium;
my $sel = WWW::Selenium->new( ... );
$sel->start;
$sel->open("https://www.google.co.in/");
$sel->window_maximize()
0

All Articles