problem in $sel->open_ok("http://google.co.uk/")..

31 views
Skip to first unread message

Arindam

unread,
May 30, 2010, 1:33:32 PM5/30/10
to Selenium Users
Hi,
I am trying to store the output of my Selenium RC+Perl in an excel
sheet. If the command "open_ok" is successful, Pass will be written in
the test result otherwise Fail.

if(like($sel->open_ok("http://google.co.uk/"))){
$template->AddCell(0, $row+1, $col+1, "Home Page :http://
www.google.co.uk/");
$template->AddCell(0, $row, $col+2, "Pass");
}

But I am getting the following error:-

Not Enough arguments for Test::More::like at C:\Selenium\test9.pl line
41, near "))"
Execution of C"\Selenium\test9.pl aborted due to compilation errors.

Any suggestions ?? Please let me know.

Thank you in Anticipation,
Regards,
Arindam Pattanayak

============

Elias Nogueira

unread,
May 30, 2010, 1:44:48 PM5/30/10
to seleniu...@googlegroups.com
Hello Ariandam!
I don't know Perl, but I think in two possibilities...
   - the command 'sel->open_ok' doesn't exist... Wouldn't be 'sel->open' ?
   - the command 'like' exists?

You would do the open command and pass to your excel argument the 'pass' argument ... if the script fails you put in perl exception the fail argument...

Regards!
--
Elias Nogueira, CSTE
elias.n...@gmail.com

CSTE - Certified Software Tester
Blog: http://sembugs.blogspot.com
Twitter: http://twitter.com/eliasnogueira
LinkedIn: http://www.linkedin.com/in/eliasnogueira





--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


murari tikmani

unread,
May 30, 2010, 2:03:28 PM5/30/10
to seleniu...@googlegroups.com
sel->open_ok is acceptable command in perl, if we use Test::WWW::Selenium module. It returns ok/false.
Similarly, 'like' is acceptable command if we use Test::More module

I think issue is with number of arguments 'like' requires.

-murari 

Neeraj Srivastava

unread,
Jun 2, 2010, 1:00:25 AM6/2/10
to seleniu...@googlegroups.com
Hi,
like subroutine is use to match regular expressions. Its just for convenience purpose only. and the return type of like is also not true/false.
so it won't be able to say the pass or fail. In fact use of if($sel->open_ok("http://google.co.uk/")){some code}
will suffice. the $sel->open_ok("http://google.co.uk/") command will return true/false.
so in any case if the command passes it will execute if stmt.
give it a try and let me know
also if you are using like for some specific reasons then some other workaround would be needed.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.




--
Success is falling nine times and getting up ten.
Neeraj Srivastava
@ARICENT

Bob McConnell

unread,
Jun 2, 2010, 10:19:32 AM6/2/10
to seleniu...@googlegroups.com
From: Elias Nogueira

> I don't know Perl, but I think in two possibilities...
> - the command 'sel->open_ok' doesn't exist... Wouldn't be
'sel->open' ?
> - the command 'like' exists?
>
> You would do the open command and pass to your excel argument
> the 'pass' argument ... if the script fails you put in perl
> exception the fail argument...

like(sel->open_ok()) is redundant. you only need the sel->open_ok() to
do what you need. like() is an ok() derivative used to compare values.

Bob McConnell

Reply all
Reply to author
Forward
0 new messages