Forum Discussion
- npaisleyStaff
Hey meghaphophalia!
We have a built in method called 'OpenFile' you can use on objects to upload files, like the Open File dialog in windows.
Below are 2 documents that cover working with Open and Save file dialogs and the OpenFile method itself that you can use to accomplish what you are looking for.
Working With Open File and Save File Dialogs;
OpenFile Method;
- meghaphophaliaOccasional Contributor
I user this code-
After clicking on open button in application -
Aliases.FR4.FormImageMgr.SpeedButton1.Click() --Click on ... as shown in above attached picture
let openWindow = process.Window('#32770','Open')
openWindow.OpenFile(Project.Path+"...\\Test_Data\\product.jpg")but it throws error for Process keyword .Can you lemme what to configure about process .
- npaisleyStaff
Hi meghaphophalia!
Looks like how you are instantiating your openWindow variable is incorrect.
What we need to do is create a variable that contains just the 'Sys.Process' for your application, then we run the OpenFile method on your object in the variable.
Here is the example from the above documentation you can use to build this out.
function WorkWithFiles() { var notepad = Sys.Process("notepad"); var wndNotepad = notepad.Window("Notepad"); // Open a file in Notepad wndNotepad.MainMenu.Click("File|Open..."); notepad.Window("#32770", "Open").OpenFile("C:\\MyFile.txt"); // Save the file to the desktop var strDesktop = WshShell.SpecialFolders.Item("Desktop"); wndNotepad.MainMenu.Click("File|Save as..."); notepad.Window("#32770", "Save As").SaveFile(strDesktop + "\\MyFile.txt"); }
Related Content
- 2 years ago
- 2 years ago
- 8 years ago
- 4 years ago
Recent Discussions
- 2 hours ago
- 12 hours ago