The first step in getting started with Helium for Java is to ensure that you have a JDK version 8
or higher installed. Once you have done this, please also make sure that you can execute the commands
javac
and java
in your Linux terminal.
Next, please download Helium from our
download page (be sure that Java is selected as the language and Linux as the Operating System).
You should get a file called helium-java-x.x.x-osx.zip
, where x.x.x
represents Helium's version number (eg. 1.3.5
).
Extract this archive to a folder on your computer. For example, if you extracted to your home
directory, then you should get a folder similar to the following:
You can now already see Helium in action! In the examples/Google/
subdirectory of
the Helium directory shown above, you will find a run.sh
batch file. If you run this
file, you will see Helium perform a Google search. To run the script, you need to open the Terminal.app,
navigate to the Helium Google example directory, type ./run.sh
and press ENTER:
To get started experimenting immediately, you can use your favorite text editor to edit the
file Google.java
in the example directory. Feel free to make any changes. The example is
there solely for educational purposes and in the worst case you still have the original code in the Zip archive.
Once you have saved your changes, you can execute run.sh
again to see their effect.
Some people will prefer to use an IDE such as IntelliJ
IDEA or Eclipse to edit their scripts. Whichever tool you use,
all you need to do is to ensure that the JAR files in Helium's heliumlib/
subdirectory
are on your classpath. The run.sh
file mentioned above is a good example of this.
It consists of the following lines:
javac -cp ".:../../heliumlib/*" Google.java
java -cp ".:../../heliumlib/*" Google
The crucial part is "../../heliumlib/*"
. It instructs Java to
include all JAR files in the heliumlib/
directory on the classpath. Please note that
Java is very specific about the format of this wildcard inclusion: It needs to be surrounded by
quotation marks "..."
and must end in a single *
(eg. ../../heliumlib/*.jar
would not be valid).
Once you have executed the above steps, you are all set to automate web sites with Helium!
For inspiration, you may want to look at some of the other examples on our
Examples page
or dive straight in with
the list of Helium's API commands.
If you encounter any problems, please do not hesitate to drop us a line on our
contact page :-)
The first step in getting started with Helium for Python is to ensure that you have Python installed.
If you don't, please download and install it from
the official download page.
While Helium works with
any Python version >= 2.6, we recommend using Python 3 or later for new web automation projects.
Next, please download the helium-python-x.x.x.zip
file from our download page, where x.x.x
represents Helium's version number (eg. 1.3.5
).
Extract this archive to a folder on your computer, for example~/Tools
. You should
get a directory similar to the following:
The final configuration step is to update your PYTHONPATH
environment variable. To set the variable, you need to run the Terminal application.
Please set it to the following value, replacing ~/Tools
by whichever directory you extracted helium-x.x.x.zip
into in a previous step:
If you wish to set the PYTHONPATH variable permanently, execute the following commands in a Terminal window:
echo "export PYTHONPATH=/path/to/your/helium-python-x.x.x/heliumlib" >> ~/.bashrc
source ~/.bashrc
Be sure to replace /path/to/your/helium-python-x.x.x/heliumlib
by the actual path to your
heliumlib
folder.
And that's it! To verify you have done everything correctly,
start a Terminal window and type python
followed by Enter. Then, enter the commands below. If you don't have Google Chrome installed,
replace start_chrome()
by
start_firefox()
:
from helium.api import *
start_chrome()
A browser window should open and your Terminal should display something similar to the following:
If you run helium for the first time, you might get the following dialog displayed:
Simply click Allow in order to ensure the correct behaviour of the library.
You can now start experimenting with Helium! For instance, try typing in the following commands:
from helium.api import *
start_chrome()
go_to("google.com")
write("Helium")
press(ENTER)
click("Wikipedia")
If you have any questions or problems, please feel free to get in touch with us on our contact page. :-)