Highlighted
Respected Contributor.
Respected Contributor.
319 views

Re: directory explorer in UFT

Hi

 

We have an application which need to run some file from the directory explorer.

The issue is that we cannot control where directory explorer to be open every time unless we open it before.

Then the application can ‘remember’ to open at that directory.

Here is the code to open directory explorer through recording

 

'Window("ABC").WinMenu("Menu").Select "File;Play Script..."

                Window("ABC").Dialog("Choose a script file to").WinObject("Items View").WinList("Items View").Activate scriptName

 

where the script is one of the file listed in directory explorer.

 

Is there any way to open directly to specific directory rather than application itself to remember it?

 

Thanks a lot

0 Likes
3 Replies
Highlighted
Knowledge Partner
Knowledge Partner

Re: directory explorer in UFT

Yes you can execute a file (using ExecuteFile) from a specific directory. The problem is - Can you UFT script ascertain which directory to use?

Mark Smith.

Highlighted
Respected Contributor.
Respected Contributor.

Re: directory explorer in UFT

Hi

Appreciate if you can show me the example how to execute this command?

Thanks

 

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: directory explorer in UFT

ExecuteFile "C:\MyScriptDirectory\" & ScriptName

Mark Smith.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.