Java Web Start Automation
abstract
This section details how to test Java Web Start Automation.
If you are not familiar with Sahi Pro, see Quick Tutorial on Sahi Pro
To automate java applications using Sahi Pro Flowcharts, refer Java Web Start Automation.
Introduction
Sahi Pro Desktop Add-on provides support for automation of Java Web Start Application.Identifying and Recording Java Web Start
Open Java Web Start from Sahi browser
- Bring up the browser of your choice by clicking on any of the browser icons present on Sahi Dashbord.
- Enter jnlp application path in the space provided for "start URL" and click "GO" , to start the application (Download and save the JNLP application on local file system before hand.)
-
Launch the Controller by clicking on
Sahi Controller
link present on the Sahi start page. You can now start identifying/recording.
Like normal Sahi Pro for web pages, you can use CTRL-Hover to identify various elements on the Java Web Start application. - Open a command prompt and cd to sahi/userdata/bin (or click on the "Bin" link on the Sahi Dashboard)
- For Windows: Invoke java_app.bat with the jnlp application path to start the application
(Download and save the JNLP application on local file system before hand.)
D:\Sahi_Pro\userdata\bin>java_app.bat <javaws applicationPath>
- For Linux: Invoke java_app.sh with the jnlp application path to start the application
(Download and save the JNLP application on local file system before hand.)
~/sahi_pro/userdata/bin>./java_app.sh <javaws applicationPath>
- To Launch Sahi Controller, click the Desktop icon on the Sahi Dashboard. You can now start recording. Like normal Sahi, you can use CTRL-Hover to identify various elements on the Java Application.
- To use "Evaluate expression" on Java Web Start applications, choose
"Sahi-Java"
. - For script playback in Controller Playback tab, select Start Mode as "Java" before "Play".
- To start a JNLP file, use _launchJavaApplication($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 _launchJavaApplication
- All code interactions with Java Web Start application will need to be preceded by _setMode("JAVA")
infoTo open Java Web Start Application from Sahi browser, Sahi Browser capability should be enabled.