Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Selenium WebDriver with Perl

I am creating a sample script using perl for Selenium WebDriver. I have downloaded selenium-server-standalone-2.32.0.jar file and I am executing following code:

use Selenium::Remote::Driver;
use Test::More qw( no_plan ) ;
my $driver = new Selenium::Remote::Driver();

$driver->get("http://www.google.com");
$driver->find_element('q','name')->send_keys("Hello WebDriver!");
ok($driver->get_title =~ /Google/,"title matches google");
$driver->quit();

but for this code to work I have to start java server using following command:

java -jar selenium-server-standalone-2.32.0.jar

Do I have to explicitly start the server to run the script? Or, there is something else I can do like setting environment variable etc. so that I don't have to start the server like in java we don't explicitly start the server.

like image 383
user2380514 Avatar asked Nov 29 '25 15:11

user2380514


1 Answers

The documentation clearly states:

To use this module, you need to have already downloaded and started the Selenium Server (Selenium Server is a Java application).

like image 150
innaM Avatar answered Dec 02 '25 10:12

innaM