Here is the difference between Array and dictionary in QTP.
Below comparison illustrates when we should use array and dictionary.
Dictionary object has many in built functions that help us add, remove, access the elements by unique key. That is why we must use dictionary over array.
Please note that array does not have any methods to add/remove the elements.
Below comparison illustrates when we should use array and dictionary.
Array
|
Dictionary
|
|
1
|
We can have dynamic array
|
We do not have concept called dynamic Dictionary.
|
2
|
Before use of array we must set the
size of array
|
We do not need to set the size of
dictionary.
|
3
|
Before adding extra element into dynamic
array, We have to use redim statement
|
We do not need to write any statement
to add extra element. We just use add method.
|
4
|
We do not have any method to release
the memory if particular element is not required
|
We can remove the element that is not
required any longer.
|
Please note that array does not have any methods to add/remove the elements.
Same comparison applies for QTP scripting and VB scripting.
More interview questions and answers on arrays in QTP are given below.
More interview questions and answers on arrays in QTP are given below.
- What is the difference between dictionary and array in QTP?
- How to create dynamic 2 dimensional array in QTP?
- How to sort array of strings in qtp?
- How to create array of dictionary in qtp?
- How to define or declare array in qtp?
- How to return array from function in qtp?
- How to find the length of array in qtp?
- How to find the size of array in qtp?
- Explain the ubound function in qtp.
- Explain the split function in qtp with example.
- What is dotnetfactory object in qtp?
- Dictionary object in QTP.
No comments:
Post a Comment
Please Leave your reply. We value your feedback and inputs