Sending file path to file open dialog

  1. I need to enter the path to a file that I want to open into a Windows File Open dialog
  2. The file open dialog is opened by UI.vision from a chrome browser window
  3. How do I switch context to the File > Open window and send keystrokes that represents the file path into it?
  4. I tried switching to XDesktopAutomation without luck
  5. I also tried XType and XClickRelative without luck

Hi

You can run every files you want with this code, i tried and working

You can run bat file or other different type of files in windows.

I want to open a file and need to send keystrokes that represents the file path.

I am not trying to run a file.

What is the difference between open a file and run a file ?

In windows is the same thing, i run a txt file and it will be open by notepad.

This is to pass the path to the file from a windows file open dialog. The browser application that I am trying to automate will not accept a typed in value for the file path.

Here is how the process looks and I am stuck at step 2

You must use desktop automation and Xclick and Xtype to control windows of files

This is not web automation, this is desktop automation

https://ui.vision/x/desktop-automation

I tried to switch to desktop automation XDesktopAutomation followed by VisualAssert. It is not able to find the file name field on the overlay.

1 Like

You can try to use the box “Search desktop” after search the file, you can click the first result.

It’s not hard to create a macro, i usually create macro with desktop automation.

After Open is simple Xclick and click it.

Thank you! Will try.

Hi,

I am also stuck with this issue. using XDesktopAutomative we are not able to switch from web to desktop mode to click on the file name and enter the path and file name from the CSV file.

This is how I managed to get this to work:
{
“Command”: “comment”,
“Target”: “”,
“Value”: “Attach the invoice file”
},
{
“Command”: “click”,
“Target”: “name=_8uqvub”,
“Value”: “”
},
{
“Command”: “pause”,
“Target”: “500”,
“Value”: “”
},
{
“Command”: “echo”,
“Target”: “Switching to desktop automation now”,
“Value”: “”
},
{
“Command”: “XDesktopAutomation”,
“Target”: “true”,
“Value”: “”
},
{
“Command”: “pause”,
“Target”: “500”,
“Value”: “”
},
{
“Command”: “XClick”,
“Target”: “425,548”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “C:\Users\me\Downloads\eetv.xlsx”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “{KEY_TAB}", "Value": "" }, { "Command": "XType", "Target": "{KEY_TAB}”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “${KEY_ENTER}”,
“Value”: “”
},
{
“Command”: “XDesktopAutomation”,
“Target”: “false”,
“Value”: “”
},
{
“Command”: “pause”,
“Target”: “2000”,
“Value”: “”
},
{
“Command”: “selectWindow”,
“Target”: “tab=0”,
“Value”: “”
},
{
“Command”: “visualVerify”,
“Target”: “add attachment button.png”,
“Value”: “”
},
{
“Command”: “clickAt”,
“Target”: “#efp”,
“Value”: “”
},

1 Like

Essentially use XClick to click at a specific coordinate on your screen. This is fragile, but could work as a workaround till the issue gets fixed.

Can I ask what this issue is about? I thought the DemoXType macro (that comes with UI Vision) shows exactly that: Sending text to a file open dialog, or?