Tuesday 30 July 2013

Difference between dictionary and array in QTP

Here is the difference between Array and dictionary in QTP.
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.

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.

No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.