Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Contributor.. vcheong Contributor..
Contributor..
112 views

How to use ApplicationModel with LeanFT Grid

Jump to solution

We are planning to use LeanFT Grid to run test against application located on different environment. However, I realise that the application model generated doesn't take in the IDesktopEnvironment returned by EnvironmentFactory.Get. Is it possible to specify the grid node to use when we use the generated application model or we have to skip the application model and manually use the Describe way to describe each window,dialog and control?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to use ApplicationModel with LeanFT Grid

Jump to solution

Hi vcheong,

You are correct, the LeanFT AppModel currently does not support supplying the DesktopEnvironment as a context object.

We will look into this and think about ways to better support this use case in the future.

Currently I can suggest the following workspace:

  • Remove the top level Window\Dialog test object from the AppModel hierarchy.
  • Describe the top level Window\Dialog in your code, using the desired DesktopApplication.
  • Pass the top level Window\Dialog test object to the AppModel constructor as the context test object.

 

Points to note:

When you add a new test objects to the AppModel, don't forget to remove the top level hierarchy test objet.

General note: when you use the Grid to test Desktop technologies, please note that in order for the LaunchAUT command to work properly your application needs to be defined in the white list of the Node you are going to run your test on.

 

Here is a small Java code example, of describing the "calc" window outside the model (for simplicity I'm using regular Desktop class and not DesktopEnvironment):

 

Window calculatorWindow = Desktop.describe(Window.class, new WindowDescription.Builder()
                .childWindow(false)
                .ownedWindow(false)
                .windowClassRegExp("CalcFrame")
                .windowTitleRegExp("Calculator").build());
        
        MyAppModel model = new MyAppModel(calculatorWindow);
        model.Button().click();

 

Regards,

Anton

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: How to use ApplicationModel with LeanFT Grid

Jump to solution

Hi vcheong,

You are correct, the LeanFT AppModel currently does not support supplying the DesktopEnvironment as a context object.

We will look into this and think about ways to better support this use case in the future.

Currently I can suggest the following workspace:

  • Remove the top level Window\Dialog test object from the AppModel hierarchy.
  • Describe the top level Window\Dialog in your code, using the desired DesktopApplication.
  • Pass the top level Window\Dialog test object to the AppModel constructor as the context test object.

 

Points to note:

When you add a new test objects to the AppModel, don't forget to remove the top level hierarchy test objet.

General note: when you use the Grid to test Desktop technologies, please note that in order for the LaunchAUT command to work properly your application needs to be defined in the white list of the Node you are going to run your test on.

 

Here is a small Java code example, of describing the "calc" window outside the model (for simplicity I'm using regular Desktop class and not DesktopEnvironment):

 

Window calculatorWindow = Desktop.describe(Window.class, new WindowDescription.Builder()
                .childWindow(false)
                .ownedWindow(false)
                .windowClassRegExp("CalcFrame")
                .windowTitleRegExp("Calculator").build());
        
        MyAppModel model = new MyAppModel(calculatorWindow);
        model.Button().click();

 

Regards,

Anton

0 Likes
Contributor.. vcheong Contributor..
Contributor..

Re: How to use ApplicationModel with LeanFT Grid

Jump to solution

Thanks Anton. That make sense. Didn't realise that IWindow is a type of ITestObject.

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.