Wednesday, May 23, 2012

QTP Action Template

Whenever you open QTP new action you have to type few lines as comments, function call, execute repository etc. Here is the solution to automate it.

Following are the simple points to make it happen.

  • Create a simple text file and place your structured reusable code in the file.
    • e.g.
      '**************************************
      '    Purpose : This test case does the following:
      '        #    TODO describe about this action
      '    Assumptions    : -
      '    Effects : -
      '    Inputs : -
      '    Returns : -
      '    Author : <Author Name>
      '**************************************

      ' Force explicit variable declaration.
      Option Explicit

      ' load function library scripts
      funcCallMe(param1)

      '**************************************************
      ' Purpose: This function to be called for this action.
      '**************************************************
      Function funcCallMe(ByVal arg1)
          'TODO place your code here
      End Function
  •  Save the created text file as "ActionTemplate.mst"(must be the same name, only name recognized by QTP as Action Template) inside the directory "QTP_HOME/dat".
Now, if you will open a new test then the lines from created Template will be included in your Test.

Thursday, March 15, 2012

Eclipse: permGen or Maven error on console

Please add the following in the eclipse shortcut or eclipse.ini

For Shortcut:  place following lines in the shortcut target

"\eclipse.exe" -vm "\bin\javaw" -vmargs -Xms256m -Xmx768m -XX:PermSize=256M -XX:MaxPermSize=512M 

For eclipse.ini: place following lines in eclipse.ini
-vm 
"\bin\javaw" 
-vmargs 
-Xms256m 
-Xmx768m 
-XX:PermSize=256M 
-XX:MaxPermSize=512M

Replace the followings:
- Eclipse home
- JDK home