Highlighted
Cadet 1st Class
Cadet 1st Class
1585 views

LeanFT 14.03 - How to launch AUT using only filename and working directory .

I am using LeanFT 14.03. I want to launch the AUT using filename and working directory without the use of arguements . But the examples mentioned in the LeanFT help does not have that . So any help regarding this will be appreciated . I want to know how the autConfig.json and the actual Java code looks like. 

 

Thank You

0 Likes
4 Replies
Highlighted
Cadet 1st Class
Cadet 1st Class

Hello Anoop,

Let’s take ms calc application as an example. It resides at C:\Windows\System32\calc.exe, so the working directory will be "C:\\Windows\\System32".
The line of Java code which launches AUT will look like this:

Aut calc = Desktop.launchAut("calc.exe", new String[] {}, "C:\\Windows\\System32");

autConfig.json which allows this launch will be:

{
    "allowedAuts": [
        {
            "fileName": "calc.exe",
            "args": [],
            "workingDirectory": "C:\\Windows\\System32"
        }
    ]
}


In Windows file autConfig.json should be created at <local app data>\Hewlett-Packard\LeanFT\config\ (see more about autConfig.json here)
Don’t forget to restart LeanFT Runtime Engine after modifications in autConfig.json.

Regards,
Evgeny

0 Likes
Highlighted
Cadet 1st Class
Cadet 1st Class

Thank You Evgeny. That worked . 

0 Likes
Highlighted
Cadet 3rd Class
Cadet 3rd Class

Error:
Verify that the AUT is configured in autConfig.json. fileName=java, args=[undefined], workingDirectory=undefined

Code:

Aut calc = Desktop.launchAut("calc.exe", new String[] {}, "C:\\Windows\\System32");

autConfig.json

"allowedAuts": [
{
"fileName": "calc.exe",
"args": [],
"workingDirectory": "C:\\Windows\\System32"
}, ...

leanft stopped and started

But still not working -
any hope for help during my testing?

0 Likes
Highlighted
Cadet 1st Class
Cadet 1st Class

Hello Jen1590,

As far as I can see the error you are getting does not correspond to the code and autConfig.json you are using.(e.g. there is fileName=”java” in the error message, but attached code and autConfig.json have “calc.exe”)

 Could you please provide us more data?

  1. It would be great if you can share how to start AUT you are trying to launch with command line.  Let’s say you want open 1.txt file from c:/temp/ with notepad.exe. Using command line you can do it like: “C:\temp>C:\Windows\System32\notepad.exe 1.txt”
  2. Please share your code (at least the line with launchAut ) and autConfig.json
  3. LeanFT version, OS, programming language you are using.

 

You can also find docs about autLaunch here:

https://admhelp.microfocus.com/leanft/en/14.03/HelpCenter/Content/CodeSamples_Java/LaunchAUT_Samples_Java.htm

and autConfig description here:

https://admhelp.microfocus.com/leanft/en/14.03/HelpCenter/Content/HowTo/TestObjects_Manual.htm#Run

 Regards,

Evgeny.

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.