Thank you, Corion, for your trustworthy help, as always.
This snippet in the OP:
$res = $sel->get_eval( q{ WebDriver driver = ((WebDriverBackedSelenium +) selenium).getWrappedDriver(); driver.manage().window().setSize(1040,768);} );
does define "driver" ok.
As you can see, when replacing it with:
my $js = q{((WebDriverBackedSelenium) selenium).getWrappedDriver().man +age().window().setSize(1040,720);} ; $sel->get_eval($js):
(as suggested in Matthias' comment here: http://stackoverflow.com/questions/24585497),
it produces the error:
missing ) in parenthetical
This is typically a javascript error not pointing to a missing parentheses, but instead to invalid javascript, for some reason (sometimes: bad string representation)
(see Slaks' comment here: http://stackoverflow.com/questions/18242512).
This leads me to think that somehow, the Perl WWW::Selenium module is not passing on right the javascript string to the Selenium server.
See here, too: http://geekandpirate.wordpress.com/2010/12/11/missing-in-parenthetical/
In reply to Re^2: Selenium: Trying to resize window from Perl: getting a mysterious JavaScript error
by HelenCr
in thread Selenium: Trying to resize window from Perl: getting a mysterious JavaScript error
by HelenCr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |