LeanFT

LeanFT C# Tutorial Part 4 – Application Models

There are two ways in which we can specify the properties of the objects that will be used in our script:-

1. Descriptive Programming – This is the approach that was demonstrated in the previous tutorial where we specified the object’s properties in the TestMethod itself(by copying the object properties on the clipboard).

2. Application Model – Application Model is to LeanFT, what object repository is to UFT. Simply put together, its a collection of Test objects that we can use in our scripts. It acts as a centralized repository which can be shared across different scripts.

Which approach is better is a very subjective question and I will leave that to you to figure out which suits you best. Here is how we can create Application Models in LeanFT:-

1. Either create a completely new LeanFT Application Model Project(by going to File-> New Project-> Test) or Add a new Application Model Project to your solution(right click on Project in Solution explorer and add LeanFT-> Application Model).

2. Define the name of the model as well as a class name. Once the Application Model tsrx file is created, you can start adding objects to it.

3. There are two ways in which we can add the objects:-

a) Specify the object type and properties explicitly by clicking on the + icon on the top left corner:-

AppModel1

b) Open the Object Identification center and after selecting the appropriate object, click on the add to App Model icon :-

AppModel3

After you have the required objects in the Application Model, you can refer to these objects using intelli-sense in the TestMethod code that you can write:-

AppModel4

So this is how you can add objects to the application model and use them in your scripts.

LeanFT C# Tutorial Part 5 – Find Child Objects

Happy Automating !
Harshit Kohli

Advertisements

1 reply »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s