18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Not able to import files - Thru Java Applet
Hi,
In one of the pages in my application, there is a java applet for file selector. The applet has a text area which displays the selected files and three buttons - Add files, Add folders and Remove. On clicking the Add files button application will bring up a applet file chooser which is similar to windows file chooser.
While using the recorder if i scroll the mouse over the "Add Files" button i am seeing following line in the accessor field of the recorder window
"top.view.workarea.content.frames[0].document.getElementsByTagName('div')[5]"
If i call _click(top.view.workarea.content.frames[0].document.getElementsByTagName('div')[5]);
in my script, the "Add files" button is getting clicked and my script runs with "SUCCESS" as the status. But, the file chooser is not coming up - though after giving wait statement.
If i call _click(_button("Add Files")); in my script, the "Add files" button is NOT getting clicked and my script runs with "FAILURE" as the status.
The help I am looking for is:
1. How do i bring up the applet "File chooser" after clicking the "Add files" button
2. How do i import a file via applet file chooser
P.S:
1. I went thru the API documents and found _setFile API. Since i don't find <input type="file" tag in my application page HTML code i don't know how to use it. I think since the file chooser component in my application is handled as an applet i don't find this file input in the html page
2. In the same page where i have to select file, i have a button "Next" to go to the next page. This is not part of the applet.
3. I am pasting the key applet param tags
In one of the pages in my application, there is a java applet for file selector. The applet has a text area which displays the selected files and three buttons - Add files, Add folders and Remove. On clicking the Add files button application will bring up a applet file chooser which is similar to windows file chooser.
While using the recorder if i scroll the mouse over the "Add Files" button i am seeing following line in the accessor field of the recorder window
"top.view.workarea.content.frames[0].document.getElementsByTagName('div')[5]"
If i call _click(top.view.workarea.content.frames[0].document.getElementsByTagName('div')[5]);
in my script, the "Add files" button is getting clicked and my script runs with "SUCCESS" as the status. But, the file chooser is not coming up - though after giving wait statement.
If i call _click(_button("Add Files")); in my script, the "Add files" button is NOT getting clicked and my script runs with "FAILURE" as the status.
The help I am looking for is:
1. How do i bring up the applet "File chooser" after clicking the "Add files" button
2. How do i import a file via applet file chooser
P.S:
1. I went thru the API documents and found _setFile API. Since i don't find <input type="file" tag in my application page HTML code i don't know how to use it. I think since the file chooser component in my application is handled as an applet i don't find this file input in the html page
2. In the same page where i have to select file, i have a button "Next" to go to the next page. This is not part of the applet.
3. I am pasting the key applet param tags
<param name=\"RSLT_KEY\" value=\"CustomImportContainer_fileselector_0\">\n<param name=\"MSG_DLG_CANCEL_BUTTON\" value=\"Cancel\">\n<param name=\"MSG_PNL_ADD_FILES_BUTTON\" value=\"Add Files\">\n<param name=\"MSG_DLG_FOLDERS_TITLE\" value=\"Select Folders\">\n<param name=\"MSG_DLG_FILE_TYPE_LBL\" value=\"File types:\">\n<param name=\"MSG_DLG_FILES_TITLE\" value=\"Select Files\">\n<param name=\"MSG_DLG_FILE_NAME_LBL\" value=\"File name:\">\n<param name=\"MSG_DLG_FOLDER_TITLE\" value=\"Select Folder\">\n<param name=\"MSG_DLG_FILE_TITLE\" value=\"Select File\">\n<param name=\"MSG_DLG_LOOK_IN_LBL\" value=\"Look In:\">\n<param name=\"MSG_PNL_REMOVE_FILES_BUTTON\" value=\"Remove\">\n<param name=\"MSG_FOLDER_SELECTION_ERROR\" value=\"Folder not found. Please, verify the folder name and try again.\">\n<param name=\"MSG_FILE_SELECTION_ERROR\" value=\"File not found. Please, verify the file name and try again.\">\n<param name=\"MSG_DLG_FOLDER_NAME_LBL\" value=\"Folder name:\">\n<param name=\"MSG_PNL_ADD_FOLDERS_BUTTON\" value=\"Add Folders\">\n<param name=\"MSG_DLG_SET_BUTTON\" value=\"Set\">\n<param name=\"MSG_DLG_OK_BUTTON\" value=\"OK\">
Comments
Sahi does not support applets currently. If this is an urgent issue, send me an email and we can work out how to automate this.
Regards,
Narayan