Micro Focus QTP (UFT) Forums
Test Script that can record the actions.. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Test Script that can record the actions.. (/Thread-Test-Script-that-can-record-the-actions)



Test Script that can record the actions.. - Sborrus - 09-03-2010

Hi All,

is it possible to create a Test Script that records (by interacting with an Add-In) every action?

in other words, instead of using "Record" function of QTP, i'd like to create a Script that makes it automatically (adding other info useful for me)..

is it possible?


Thanks in Advance,


RE: Test Script that can record the actions.. - balaji4u - 09-03-2010

Hi Sborrus,

Your requirement is exactly the same are record function as you it self specified , but why is this requirement ?...Its not an impossible task but its a complex task as far as i know , but is it worth creating it ?... If you analyse your question it all comes down to providing one more Record option isn't ?... Can you please specify what exactly you want to achieve here :-)

Regards,
Balaji


RE: Test Script that can record the actions.. - Sborrus - 09-03-2010

Hi Balaji,

i made a test script that creates a mapping class of all items in a Sap application.
in example:

you can call the method ClickSAPGuiButtonSave, inside the method there's the logic for pointing to Save Button by using Descriptive Programming

Now my idea is to customize recording:

you launch the RecorderTest, first of all it maps the sap window, then it records all your interactions and translate them in calling to mapping class methods..

finally i'll got a test script completely written in Descriptive Programming!

too insane? :-)

Thanks Again for your answer


RE: Test Script that can record the actions.. - balaji4u - 09-03-2010

Hi Sborrus ,

It doesn' t sound insane it sounds great .... Firstly good to know that you are working on a SAP appln
[ I am a former employee of SAP :-) ] ... As per my understanding you want to create a test library of your own ..?Your ClickSAPGuiButtonSave mainly wrappers a logic to call SAP Standard GUI and you want to expose the methods from these GUI objects and perform operations using this API...? So in a way what you do is instead of recording a set of GUI operations , you embedded the recording functions in these set of API's and form a library of your own and customise it according to your requirement ?..... Is my understand rite ?...

Regards,
Balaji


RE: Test Script that can record the actions.. - Sborrus - 09-03-2010

yes, you understood.

Actually i have to launch a script for every single Window you meet in SAP application. For every launch my script generates a test library containing a mapping class for a particular window.
It wraps the logic to call an item event (click for Buttons, set for Edit, select for Combo...etc) and exposes only the methods (with a mnemonic) to the outer world for interacting with them in a simpliest way

For now it is a very boring and slow process, but it let me distinguish the logic of a single test script from the visual objects it uses.

So, there's the possibility to create a test script "listener" of the actions in order to let the things faster?

Regards


RE: Test Script that can record the actions.. - balaji4u - 09-06-2010

Yes you can actually do that , your intention might be to create a framework of your own...
Let's think of a rough design perspective. Let's create a library of objects which can access SAP GUI elements and this library can be called within QTP as an Add in( i suppose that is what SAP add in within QTP does) . So your library can have listener objects which are capable of registering the GUI object actions and perform validation steps , so i would say for each family of objects you can create a library .. But there is huge overhead involved when it comes to maintaining this library as it frequent changes to the object definitions could make your library invalid , hence QTP was probably built as a GUI framework with functionalities to update the object repositories dynamically at runtime when the object changes , however to test some standard object you can follow your approach.

Regards.
Balaji


RE: Test Script that can record the actions.. - Sborrus - 09-13-2010

don't you know how can i manage recording in a Test Script?