in reply to Executing selenium scripts automatically on cloud server using Perl

Have you looked at what CPAN has to offer for Selenium?

Also, I believe that Selenium wants mostly to run in a browser, so you will likely need to fire up a web browser on the "cloud machine" which then interprets the Javascript and HTML.

Also, a likely approach to get Selenium to run the script would be to take the same approach you use to launch Selenium on a machine not in "the cloud". "The Cloud" is not magic, it is just a marketing buzzword with little meaning.

  • Comment on Re: Executing selenium scripts automatically on cloud server using Perl

Replies are listed 'Best First'.
Re^2: Executing selenium scripts automatically on cloud server using Perl
by mkhan (Sexton) on Jun 27, 2011 at 12:32 UTC
    After a sleepless night I finally got bits of it working.

    Apparently, once I transfer the files to the server using CGI, what I have to do is just:
    1. Export the selenium test cases as Perl scripts.
    2. Install the necessary modules. (Could just bundle it up on server one time.)
    3. Execute these scripts in the background on the server (cloud instance) directly using Perl
    4. Test::More will tell me if tests have passed or failed
    5. I could simply retrieve the status and carry on with life =)

    Thanks!!! Any further contributions to this discussion are welcome
      I think you do not need the cgi step, you can connect directly to the selenium server.

      So on the server machine you start your selenium server: java -jar selenium-server.jar

      On the client, you run a perl script like this:

      use Test::WWW::Selenium my $sel = Test::WWW::Selenium->new( host => "your server's ip", port => 4444, browser => "*firefox", browser_url => "http://www.google.com", ); # your test script goes here

      Maybe you have to tweak the firewall settings on the server to make this work.

      Couple of more things ..

      1. WWW::Selenium offers most of the things I need.

      2. My back is hurting, I'm sleepless and in a terrible state but the awesomeness of Perl solutions bring tears of joy.
      Don't eat the yellow cloud, its not candy :)