tridib.bolar has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

Hope you are all fine :).

I have one unusual requirement for my current project. I need to call a Java applet using Perl script and unfortunately I am new in Perl programming. My detail requirement is given below?

My requirement is, I need to write a script which can automatically log into my website and from there it should crawl into a particular link, which will help to open an applet, and the script should be able to click on some button on the applet to get some response from the applet. I have to write a script to automate this whole task. Currently I can able to log into the website using LWP::UserAgent, but after that I am not able to understand how to crawl into the destination link and how to open the applet. I have come to know from google that there is the LinkExtor class in perl to crawl into the different link, but I am not able to use the same. I am sending my auto login code for your ease. If there is any possible solution please let me know.

Thanks in advance.

use HTTP::Request::Common;

use LWP::UserAgent;

use HTML::LinkExtor;

$URL='http://<my_server>:<my_port>/<my_path>/login.jsp';

$browser = LWP::UserAgent->new();

$browser->timeout(1000);

$response = $browser->post($URL, [ UserId => ‘user_id’, Password => 'password' ] );

if ($response->is_error()){printf "%s\n", $response->status_line;}

$contents=$response->content();

print $response->as_string;;

print $contents;

Thanks

-Tridib

  • Comment on How can I call Java applet using Perl script

Replies are listed 'Best First'.
Re: How can I call Java applet using Perl script
by Anonymous Monk on Dec 19, 2008 at 01:15 UTC
      Thanks Monk, I will work with your suggestion, but if you have any code snippet or any easy tutorial regarding this can you please share with me?

      Thannks & Regards

      Tridib

Re: How can I call Java applet using Perl script
by imrags (Monk) on Dec 19, 2008 at 05:23 UTC
      GuiTest along with AppletViewer might be enough, but if the applet just talks CGI to some server, it can be bypassed.
        Thanks Raghu, I will try with your suggestion. but if you have any code snippet or any good tutorial regarding these can you please let me know?

        Thanks & Regards

        Tridib