Sahi - Java Web Start Automation
abstract
This section details how to test Java Web Start Automation.
If you are not familiar with Sahi Pro, please see Quick Tutorial on Sahi Pro
If you are not familiar with Sahi Pro, please see Quick Tutorial on Sahi Pro
Introduction
Sahi Pro Desktop Add-on provides support for automation of Java Web Start Application.Installation
DownloadSahi Pro
and Sahi Pro Desktop Add-on
from Downloads Archive.Install
Sahi Pro
into a folder without spaces in its path.Then install
Sahi Pro Desktop Add-on
into the same folder as Sahi Pro
.For details about installation please refer here
License
Sahi Pro Desktop Add-on needs a separate license from Sahi Pro.Register here for a 30 day fully functional trial version.
Recording Java Web Start
- Open a command prompt and cd to sahi/userdata/bin
(or click on the "Bin" link on the Sahi Dashboard)
- Invoke java_web_start.bat with the jnlp application path to start the application
(Download and save the JNLP application on local filesystem before hand.)
D:\Sahi_Pro\userdata\bin>java_web_start.bat <ApplicationPath>\<ApplicationName>.jnlp
-
From the Sahi Dashboard, open any browser and launch the Controller.
You can now start recording.
Like normal Sahi Pro for web pages, you can use CTRL-Hover to identify various elements on the Java Web Start application.
info
Security Settings
If the web start application is not behaving as expected, you might need to set Java security settings as follows:
If the web start application is not behaving as expected, you might need to set Java security settings as follows:
- Find the
<JAVA_HOME>\lib\security\javaws.policy
file. - Edit the file with these settings:
grant codeBase "file:${jnlpx.home}/javaws.jar" {
permission java.security.AllPermission;
};
grant {
permission java.security.AllPermission;
};
Scripting Notes
- To start a JNLP file, use _launchJavaWSApplication($jnlpFile) API.
- If you need to download the JNLP everytime, navigate to the page with JNLP, and once Sahi downloads
it, use _saveLastDownloadedAs() API to save it to desired location and then call _launchJavaWSApplication - All code interactions with Java Web Start application will need to be preceded by _setMode("JAVA")
-
For executing Java Web Start application only scripts, use "generic" as Start Mode, and use _setMode("JAVA") at the start of script.