use strict;
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";
use Test::Exception;
use Text::Table;
our ($a,$critical);
print "Enter text:";
$a = <>;
print "Enter critical value:";
$critical = <>;
print $a;
print $critical;
|
|
|
|
|
$sel->click_ok("//div[\@class='x-combo-list-inner']/div[8]");
my $v7 = $sel->get_text("//div[\@class='x-combo-list-inner']/div[8]");
print($v7 . "\n");
print($critical . "\n");
if ($critical eq $v7)
{
perform operations
}
else
{
don't perform operation
}
我从 cmd i 输入的关键'Last 45 Days'
值和从 div[8] 检索到的值以及上述代码中存储在 v7 中的值也是相同的('Last 45 Days')
。但是当它遇到 if 循环时,它不执行操作。还有其他方法可以比较这些字符串吗?