Which Perl bindings for selenium webdriver? - perl

I am new to selenium 2.0 and working on automation through perl and java(maven-eclipse). I want to know the perl bindings for Se differ.
Selenium website shows https://metacpan.org/module/Selenium::Remote::Driver
While CPAN also has WWW:Selenium bundle....
Which to use to perl automation in this context?

Selenium::Remote::Driver is the one you want. WWW:Selenium is old.

You can visit the following URL:
http://repo1.maven.org/maven2/org/seleniumhq/selenium/client-drivers/selenium-perl-client-driver/

Related

Is Active Perl Does Not Support any Extra CPAN Module?

I am using Crimson Editor as a text editor and I think it suports only Active Perl as a compiler. I downloaded some new CPAN modules for emailing etc etc. I added them in Perl library but program still doesn't recognize those modules. Can you please help me? Is Active Perl doesn't support any extra modules? If so, what do you suggest me for Perl compiler?
Is Active Perl doesnt support any extra modules?
It does, but it has its own way of doing it called PPM. Because many Perl modules require Unix tools and a C compiler, these are pre-built for you. Unfortunately these packages are often well behind CPAN release and are often missing CPAN modules altogether.
If so, what do you suggest me for Perl compiler?
On Windows, I'd recommend using Strawberry Perl. It comes with a full environment necessary for building and installing Perl modules, including a C compiler. Then you can install things using the normal CPAN tools like cpan or cpanm.
I am using Chrimson Editor
It doesn't look like that editor has been updated in over 10 years, and it's very Windows specific. I'd suggest an editor like Sublime Text. It's cross-platform, so you're not stuck with a Windows-specific editor, it has good Perl support, and it's kept up to date.
I would also not get too attached to relying on your IDE to do all your compiling and running of code for you. If you do, you're limited to what your IDE supports, and your IDE can get in the way of understanding your tools. Instead, I'd suggest getting used to using the tools directly. Learn how to use Perl on the command line rather than via the IDE.

Invoking a HTTP URL from perl script - Perl Version 5.8.4

We have perl version 5.8.4 installed on our servers. I am trying to invoke a HTTP URL from within the perl script and based on the output that the HTTP URL returns I have a logic to be executed.
I am very new to perl and am looking for help to achieve this. The Cpan and other modules seem to be unavailable with the current version we have.
Please let me know how we could achieve this.
Thanks,
Sachin
Take a look at LWP and LWP::simple.
Even older versions of perl will have support for this library, although you may have to install it via cpan.
We have perl version 5.8.4 installed on our servers
Then that should be the first thing that you fix. 5.8.4 is ten years old. It is completely unsupported.
The Cpan and other modules seem to be unavailable with the current version we have.
No. CPAN works fine with versions of Perl back far earlier than 5.8.4. If you are having a problem using them that is a local problem that you should work on getting fixed. Good Perl programming is a case of wiring together the correct CPAN modules. If you can't install CPAN modules then you are missing most of the power of Perl.
The correct answer to your problem is to install LWP::Simple and use its get function. If you don't want to do that, then reading the source code for that module will show you the lower level code that you would need to write.

Configuring Selenium RC with Perl

I want to use Selenium RC with a Perl client driver. How can I configure Selenium RC with Perl?
Use the WWW::Selenium module to link up to Selenium RC.
You will need to have Selenium RC running in the background in order for it to operate.
A technique that I have found useful to launch it from within Perl is to execute it on a separate thread and then immediately detach it:
use threads;
my $seleniumThread = # Assumes that your Selenium RC file is in the current dir
threads->create( sub { system "java -jar selenium-server.jar"; } );
$seleniumThread->detach;
# Avoids the main program from having to wait for the system call to end
The following question may be useful as well:
How can I use Perl to scrape a website that reveals its content with Javascript?
Just a heads-up... for Selenium 2.0, you'll want to use the Selenium::Remote::Driver module instead; WWW:Selenium is for 1.0.
From the Selenium docs (http://seleniumhq.org/docs/03_webdriver.html):
Perl bindings are provided by a third party, please refer to any of their documentation on how to install / get started. There is one known Perl binding as of this writing. [with a link to https://metacpan.org/module/Selenium::Remote::Driver]

How do I add Perl scripting support to a Delphi application?

PLDelphi is a Perl project hosted on CPAN. I am currently working on a Delphi application and I am investigating the possibility of adding Perl scripting support and read about PLDelphi.
Ideally, I'd like my application to not require Perl to be installed. PLDelphi claims to support this:
To use PLDelphi from your Delphi
application without need to install
Perl you will need this files in the
main diretory of your application:
PLDelphi.dll - The PLDelphi
library that loads the Perl
interpreter. PLDelphi.pm - Perl
side of PLDelphi. Perl56.dll -
The Perl library in case that you have
Perl built dynamic. PLDelphi_dll.pas -
PLDelphi classes and DLL wrapper.
lib/* - A Perl lib directory with basic .pm files (strict, warnings, etc...)
I am aware of RemObjects PascalScript and embedding Python in Delphi, but in this instance, I am interested primarily in Perl support.
Has anyone used PLDelphi with success? Or have you found other ways to execute Perl scripts from Delphi without the full Perl installation available locally?
EDIT:
To be more clear, I found 1 potential solution and that is using PLDelphi. However, I'd like to know if anyone has used it (last updated in 2004) before, and how well it worked.
I'm also interested in hearing about any other options for embedding a Perl interpreter with Delphi.
You could use Windows Script Host (which comes with VBScript and JScript by default) and install PerlScript from ActiveState.
Sadly PLDelphi isn't updated for XE3 or 64 bits there for won't work with Perl 5.16
I was really looking for a solution that didn't require installing anything on the client. It appears that PLDelphi is not working with ActivePerl 5.10...so I don't believe there is a ready solution to embedding Perl within a Delphi application.

How do you do beautiful reports when testing with Selenium under Perl?

Selenium has some nice additional libraries, as long you are using Java to write your tests, e.g. LoggingSelenium. However, these are not usable if you are writing in Perl. How do you normally do proper reporting, possibly with screenshots after every significant step etc.?
Not an ideal answer but have you looked at the Java module on CPAN? You could then use the original Java Selenium libraries such as LoggingSelenium to do your reporting. You'll need to run a Java server with the jar provided by the CPAN Java module (but if you're already using Selenium...)
You could also try Java::Import which might avoid the need to run a server.
TAP::Formatter::HTML produces nice-looking html reports. It does not do screenshots, though.