UFT:- How to script effectively and faster way to minimize maintenance effort

Hi friends, it’s been long to see you guys well let's start with awesome English quote

Its Never too late to start over,
And Never too late to be happy

let's talk about today's topic here I am going to provide very simple approaches that can help you to speed up your writing skill and accuracy on UFT coding and will decrease the maintenance effort on GUI change or error-prone.
Approach that I am going to explain here it's not new but after observing many real-time projects I feel their productivity can be increased if they include these simple approach in their framework
So 1st thing you should create an additional library for storing your objects.
Just follow below steps to implement this
Create additional function file in your projects and name as you desire by clicking on
 file >New>Function Library or directly use Alt+shift+N 

Now open your object repository and drag captured object to function library and give logical name for page by using set keyword
Ex
Set Google homepage = Browser().Page() 
Dragging object
Setting object




We are done with our first approach.
Now you will observe in your action Tab(main script area)  if you type starting word of your page name in our case its W3School homepage you will get the suggestion on list and after placing dot(.) you will get all capture object in that page no need to reopen OR again and again and every object is easy to navigate
it’s a one time approach and no matter how many objects you add in OR on a specific page its gonna display directly under your suggestion list.



OK, let's move to 2nd normalization approach which I personally use much, it's quite old but still useful if you follow page object model.
with statement
If you are an experience UFT coder then you probably know about 'with' statement, in that you have to provide preceding word which you feel is going to repeat and then single dot (. ) Will consider as a full statement however if you look closely, its just a replica of 1st approach but, within a script, I will suggest you use both the approaches.


 By that, your coding speed will increase and in case your requirement changes then modification or maintainability of code will be easy hope it will help you to customize your framework. 

At the end,  just don't forget the important point, keep variable name simple and logical


Subscribe by entering your email and get new updates in your inbox directly


2800 Email subscribers