Monday, January 14, 2013

QTP 11- File Setting Tab

In QTP11, File setting tab having 12 options.
  1. Properties - from where generate script option available
  2. Run - from where script run option can be change - datatable iteration- 1 iteration, all iteration, all row etc
  3. Resources- function libary, datatable
  4. Parameters - input and output parameter
  5. Environment - built in/ user defined variable
  6. XML warehouse
  7. web- broswer navigation timeout, active screen access
  8. java
  9. webservice - web service response timeout
  10. recovery
  11. local system monitor
  12. log tracking

About Error Handling

Error Types in QTP
  1. Syntax error- use ctlr+F7 or view>error
  2. Logical error-
  3. Run time error- can handle in following way.
    1. Test Setting
    2. On error statement- on error resume next, on error go to 0
    3. using Err object - err.description, err.clear, err.source, err.helpcontext
    4. Recover scenario- use to handle unwanted popup, app crash, object stat, test run error etc
    5. Reporter object
    6. Exit statement -exittest, exitaction, exittestiteration


On Error Resume Next
  • Provide some degree of error handling by preventing program interuption from runtime error
  • When error occurs, by using it the line of code containing the error is skipped over and program continues. it doesn't correct the error just ignore it without even displaying error message
  • Turn off the script engine error checking: On error resume next
  • Turn On the script engine to stop execution of a script when an error is encountered: on error go to 0

About ByVal & ByRef

About ByVal & ByRef
  • If argument is variable, array or array element, vb script use ByRef method.
  • If argument is expression then vbscript use ByVal method
  • By default, argument passed to function and subroutine by reference, that is the address of the argument is provided to the function or subroutine.
Example- By Ref
function fun1(ByRef a)
a=a+1
end function
dim x
x=3
call fun1(x)
msgbox x
- output will be 4

Example - ByVal
function fun1(ByVal a)
a=a+1
end function
dim x
x=3
call fun1(x)
msgbox x
-output will be 3

How to choose Testing Tool or Feasibility Study on Automation

Hi

Sometimes, we need to choose testing tool for our applicaiton or require to do feasibility study on testing tool for automation. Here, I have mention some points on it , if you people find something more write in comments so i can also learn from it.
  • feature of tool
  • scope and limitation of tool
  • type of testing to be conducted
  • client budget
  • trained/skilled resource
  • application to be tested compitable with tool
  • cost of tool
  • project / test environment
Thanks
Trupti

Difference between Array and Dictionary Object in QTP

Difference between Array and Dictionary Object
  1. Dictionary cannot be multidimension, while an array can be multidimension
  2. Dictionary has extra methods to add new item and check for existing item (Add, Item)
  3. when you delete particular item from dictionary, all subsequent item automatically shift up.

About Dictionary Object

Folks,

Here is some informaiton about Dictionary Object.
  • Dictionary object stores name/value pairs in an array.
  • It has property like count, item, compare mode,key etc
  • It has method like add, exist, keys,items , remove, removealletc.
  • It has event like initialize
example,
dim beers
set beers = createobject("scripting,dictionary")
beers.Add "a","val1"
beers.Add "b","val2"
msgbox ("value of b" &beers.item("b"))

Advantages
> can be use as global variable declaration, so that any test can access the values from it in the run time
> you can store and retrieve any number of run time values into dictionary
> it is one of the parameterization technique in QTP

Disadvantages
We can not specify the values in design time like datatable environment variable action parameter
So it is useful only run time not design time

Thanks,
Trupti