|
各位好:
最近在学习perl语言,听说selenium支持perl语言,于是想两者结合一起使用,但对selenium使用不熟悉,目前出现个问题:
执行pl脚本时,无法加载selenium相关模块(PS:selenium rc已经启动),报下列错误信息:
Can't locate Test/WWW/Selenium.pm in @INC (@INC contains: D:/Program Files/Perl/
site/lib D:/Program Files/Perl/lib .) at e:\turnning\selenium\11.pl line 4.
BEGIN failed--compilation aborted at e:\turnning\selenium\11.pl line 4.
11.pl代码:
use strict;
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";
use Test::Exception;
my $sel = Test::WWW::Selenium->new( host => "localhost",
port => 4444,
browser => "*chrome",
browser_url => "http://www.baidu.com/" );
$sel->open_ok("/");
$sel->type_ok("id=kw", "selenium");
$sel->click_ok("id=su");
$sel->wait_for_page_to_load_ok("30000");
$sel->is_text_present_ok("selenium官网");
请各位路过的大神指点下,不胜感激! |
|