We have site and want to write test. We decide to use Selenium.
May someone advice which modules to use? Are they work with recent versions of selenium? Thank you.
Did you look on CPAN? Test::WWW::Selenium seems like a good place to start.
Update: From the comments, you'll see that a better choice is Selenium::Remote::Driver.
Related
It is hard for me to choose between two perl modules - Params::Validate and Params::Check.
I am writing a Mojolicious application which should be easily distributable.
Generally I mean something like uploading a directory structure on a shared hosting and be ready to run.
Params::Validate is quite powerfull and tought, has Pure-Perl implementation.
Params::Check is in the Perl Core distribution since version 5.10.0
Can you point other "why should I prefer the one or the other"?
Looking through the CPAN bug reports for each of these modules might help you to choose. Currently, Params::Check has no bug reports (it only has one wishlist item), but Params::Validate has a few. Check to see if any bug is relevant to your application.
You could also look at the CPAN Testers platform/version matrix to see if there are any fails on platforms that you would be running on.
Using the Mojo validator probably makes sense. I just want to point out that the author of Params::Validate has shifted towards Params::ValidationCompiler
For now you can use Mojolicious::Validator for validation parameters in Mojo application. http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Form-validation
i'm looking for an improved makefile version where it has makefile/perl combined together.
Is there anything like this?
What are you trying to accomplish? Perl is a tool that does a lot of things, and make is a tool that does some things, and there's some overlap.
Maybe you're looking for pmake?
There are also alternatives to GNU make written in Perl, such as PBS.
One possibility is makepp. If you update the question with specific things you'd like to do, I can probably say whether or not makepp will help.
I'm new to Object-Oriented programming and the perldoc page on CPAN.pm confuses the hell out of me. My program needs to download a couple of modules if they don't already exist. Is this basically just:
CPAN::Shell->install("Module::Name::Here");
or is there more to it? Does that download the package, unarchive it, and install it, or just one or two of those steps? If it's not all three, how do I do the other one (or two)? I would like it to make sure it doesn't try to re-install anything if the package is already there - is this the default behavior of the function or no?
And how can I tell if Perl couldn't connect to CPAN to get the package?
No one else has mentioned it, but you have to load the CPAN config first:
use CPAN;
CPAN::HandleConfig->load;
CPAN::Shell::setup_output;
CPAN::Index->reload;
# now do your stuff
You can also look at the cpan(1) script that comes with CPAN.pm to see a lot of the programmer's interface in action. I also wrote on article for the latest issue of The Perl Review showing examples of the programmer's interface to CPAN.pm.
However, you might not need to do any of this. Why is your program downloading modules on its own? Are you trying to create a distribution that has dependencies? There are better ways to handle that so you don't have to repeat the work that's already done in other tools. For instance, see my article Creating Perl Application Distributions. You treat your program as if it's a module and get the benefit of all the cool module tools so you don't have to reinvent something.
If you tell us more about the problem that you're actually trying to solve, we might have other good answers too. :)
Good luck,
the perldoc page on CPAN.pm confuses the hell out of me.
Yes, documentation of the CPAN API is still a bit lacking. It wasn't every really designed for programmatic use by others. You might have better luck with CPANPLUS, if that's available to you.
My program needs to download a couple of modules if they don't already exist. Is this basically just: CPAN::Shell->install("Module::Name::Here");
Yes, that's pretty much it for the simplest possible thing. In fact, that's pretty much all the 'cpan' command line program does when you type "cpan Module::Name::Here". However, you will need to have CPAN.pm configured in advance.
Does that download the package, unarchive it, and install it?
Yes, all three.
I would like it to make sure it doesn't try to re-install anything if the package is already there - is this the default behavior of the function or no?
Yes, the default behavior is not to install anything if the module is up to date. You can actually check that yourself with the "uptodate()" method like this:
my $mod = CPAN::Shell->expand("Module", "Module::Name::Here");
$mod->install unless $mod->uptodate;
And how can I tell if Perl couldn't connect to CPAN to get the package?
That's hard to do programmatically in a way that would be simple to explain. You either need to look at the output or else just check $mod->uptodate afterwards;
my $mod = CPAN::Shell->expand("Module", "Module::Name::Here");
if ( ! $mod->uptodate ) {
$mod->install;
die "Problems installing" unless $mod->uptodate;
}
Best of luck!
Basically using CPAN is the following:
perl -MCPAN -e shell
if this is the first time you are running it, it will ask you a few questions and save the results in a configuration file.
then to install PGP::Sign just type:
install PGP::Sign
and you're set.
As for you last question, don't worry, it will say to you whether it can connect or not.
As you can tell, most of us use only use CPAN.pm in the interactive mode, however, you're on the right track.
Things I can point out for the moment:
Yes, calling CPAN::Shell->install() will download, compile, test and install a package. It should also do the same for any dependencies the package has, recursively.
The default behaviour is to not install anything which is already installed (unless a newer version is available).
I'm not strictly sure how the error handling works - I'll look into it, and report back.
It might prompt your user, though.
Keltia has it right. I'll add that his first instruction is done from the command prompt, usually as root, but not necessarily so. The second command is done from the CPAN prompt. You can also do it all on the command line, but I usually don't.
If you're using windows, your best bet is to use PPM, but its repositories are annoyingly out of date most times.
I need to do some quick-and-dirty Perl GUI building. I can't afford a Komodo License.
What would people recommend as a free (as in beer) alternative. I don't care if it is UNIX or Windows or both. I would be using either Win32 Perl or Perl/Tk depending on what has the best solution. I would also look at any PM's that use something else.
For Perl/Tk, there is ZooZ.
Personally, I prefer to use Glade for the GUI design and Gtk2::GladeXML. And as other people mentioned, there's also WxWidget and Qt alternatives.
The Perlmonks post http://www.perlmonks.org/?node_id=627282 might help, as well as the google search for "perl gui builder". Once you see what's available, you might be able to ask a more specific question to get a better answer.
Good luck, :)
There is a team working on acceptance testing X11 GUI application in our company, and they created a monstrous acceptance testing framework that drives the GUI as well as running scenarios.
The framework is written using Perl 5, and scenario files look more like very complex Perl programs (thousands of lines long with procedural-programming style) than acceptance tests.
I recently learned Ruby's Cucumber, and generally have been using Ruby for quite a lot of time. But unfortunately I can't just shove Ruby to replace Perl because the people who are writing all of this don't know Ruby and it's quite certain that they wont want "this" kind of interruption.
So to bring Ruby's Cucumber a bit closer to their work, I rewrote it using Perl 5. Unfortunately I am really not a Perl programmer, and would love to get a code review and to hear suggestions from people who both know Perl and Cucumber.
Hi Perl/Cucumber StackOverflow users - please help me create this "open source" attempt to re-create Cucumber for Perl! I would love to hear your comments and will accept any acceptable help.
The minimal source code is here:
http://github.com/kesor/p5-cucumber
Thank you for your attention.
For those not familiar with cucumber - please take just one small moment to take a look at this one small little page: http://cukes.info/
You might get good help on Perlmonks. That site is geared toward this sort of post, whereas Stackoverflow is more about direct and answerable questions.
Good luck, :)
There's a rather fuller implementation of Cucumber on Perl in the form of Test::BDD::Cucumber.
Can you review my Perl rewrite of
Cucumber?
Answer: Yes.
I've read through the github code you posted. It looks pretty good.
I'm curious about the following snippet from Parser::Parser.yp::ERROR. Why did you chose to use "and do {}" over "if( ){ }"? Style? scoping? other?
exists $parser->YYData->{ERRMSG}
and do {
print $parser->YYData->{ERRMSG};
delete $parser->YYData->{ERRMSG};
return;
};
I haven't used cucumber and am still trying to wrap my head around the usage model. How would someone go about verifying/running your calculator example?
If you plan to release your code to CPAN (and you should), then you'll want to bundle this git source into an installable tarball. You'll want to include one of the module installing tools: ExtUtils::MakeMaker, Module::Build, etc. I've recently started using Dist::Zilla, and am really happy with it. It got me over the activation energy of releasing my first cpan module.
20 second tour of Dist::Zilla:
download and install Dist::Zilla
and its requirements (there are
many, as it's a developer only tool)
create a dist.ini file in the top
level of your package ( 'dzil new MyPackage' )
run
'dzil test', 'dzil build', and 'dzil
release',to test, (build and test),
(build, test and release)
See the Dist::Zilla::Tutorial
Does Test::A8N fit your requirement?
If not there are plenty of other Test:: modules on CPAN which may do what you're after.