Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automate Java applet with Python

At work I need to run a Java applet every 20-30 min to re-connect to one of the internal applications.

I would like to automate the login in the website of this application and then run this Java applet that does not require any input at all, just accept it so I can just run the script every time the application logs me off.

Is there any way I can do this from Python using urllib or a similar library? I know how to do the login part, but I don't know what to do the 'accept and run this applet' part.

like image 304
Eric Avatar asked Jan 02 '12 02:01

Eric


People also ask

How do you automate a Java applet?

The only possibility for Automate to interact with controls within a Java Applet Window is to set the focus to the Java Window and use the 'Send Keystrokes' action to tab through the fields to set and get data or press buttons.

Is Java or Python better for automation?

It has fewer syntax complications than any other programming language. Selenium automation testing with Python can be the best decision ever. It has many advantages of using Python over Java for Selenium testing.

Can I use Python to automate tasks?

Python is a powerful language using which you can automate pretty much every mundane or complex task with some effort. All you need to get started is Python installed on your machine and the appropriate libraries installed on your computer.

Is Selenium with Python good?

Offers vibrant typing nature. Large numbers of programmers are accustomed to Python as a language. The API used in python helps you in connecting to the browser through the Selenium. The binding of python and Selenium offers a simple API to write functional tests by utilizing Selenium WebDriver in a perceptive way.


1 Answers

A web application testing framework would be useful for what you ask, it allows you to simulate the interactions of an user (POST, GET, login, clicks, etc.) with a web site.

The tricky part of your question, is interacting with a Java applet - not many webapp testing frameworks will allow you to do that; in particular I don't know a Python framework that offers that functionality, but in my experience, I found that HTTPUnit worked well with applets. Of course, it's in Java and not in Python, but it's worth checking out.

like image 127
Óscar López Avatar answered Sep 28 '22 23:09

Óscar López