#Here is my Perl script which is suppose to run in RC use selenium, read from an XML file and verify text of a job description
#!/usr/bin/perl
# use module
use XML::Simple;
use Data::Dumper;
# create object
$xml = new XML::Simple;
# read XML file
$data = $xml->XMLin("jobdata.xml");
# print output
print Dumper($data);
# access XML data
print "$data->{Description} \n";
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 => "*firefox",
browser_url => "http://www.sqaresources.com/" );
$sel->open_ok("/");
$sel->click_ok("Image1");
$sel->wait_for_page_to_load_ok("30000");
$sel->click_ok("Image9");
$sel->wait_for_page_to_load_ok("30000");
$sel->is_text_present_ok("$jobdata->{job}->{Description}");
#This is the data contained in the XML File jobdata.xml:
<?xml version='1.0'?>
<Job>
<Description>
* Java, SQL, Web Based Testing, LAMP (Linux, Apache, MySql, Perl/PHP)
* Use agile / scrum practices
* Responsible for the developing planning, execution, scheduling, and reporting of tests suites
* Build, maintain, and extend regression and automation suites
* Participate as a team member in testing, analysis, process management to identify and communicate risks
</Description>
</Job>
#after running get the follwing error:
Global symbol "$jobdata" requires explicit package name at perl
Execution of perlxml2.pl aborted due to compilation errors.
Want to know what is the correct syntax for the selenium is_text_present_ok for jobdata
What SQA Resource are you searching for?
How do I read from an XML File and Use with Selenium RC?
1 post • Page 1 of 1
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests