Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Using Test::WWW::Selenium and Selenium::Remote::Driver together

by nubbel (Novice)
on Jul 17, 2013 at 13:17 UTC ( #1044803=perlquestion: print w/ replies, xml ) Need Help??
nubbel has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

i try to enhance a Selenium-Perl-Script which i've recorded with the Selenium IDE.
use strict; use warnings; use Time::HiRes qw(sleep); use Test::WWW::Selenium; use Test::More "no_plan"; use Test::Exception; use Data::Dumper; use Selenium::Remote::Driver; my $sel = Test::WWW::Selenium->new( host => "localhost", port => 4444, browser => "*chrome", browser_url => " +/" ); $sel->open_ok("/portfolio/"); $sel->window_maximize(); $sel->title_like(qr/Catalog/); my @elements = $sel->find_elements('//*'); print Dumper @elements; $sel->quit();
When i run it i get folowing error: "Can't locate object method "find_elements" via package "Test::WWW::Selenium" (also tried "WWW::Selenium") at line 20".
I know find_elements is part of Selenium::Remote::Driver, therfore i included the "user Selenium::Remote::Driver" line to the script, but that's not working. Can you please tell me how to use Selenium::Remote::Driver and Test::WWW::Selenium together in one script?



Comment on Using Test::WWW::Selenium and Selenium::Remote::Driver together
Download Code
Replies are listed 'Best First'.
Re: Using Test::WWW::Selenium and Selenium::Remote::Driver together
by daxim (Chaplain) on Jul 17, 2013 at 13:43 UTC
    You can't. The testicular version of Selenium::Remote::Driver is called Test::WebDriver. However, all it gives you is a bit of syntactic sugar.

    Plain Test::More in conjunction with Selenium::Remote::Driver works just fine.


      Living without suggar is supposed be more healty ;-) But don't we all like candy (IDE)?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1044803]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2015-11-29 21:26 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (753 votes), past polls