How can i check elements sorted in dorpdown using qtp..



How can i check elements sorted in dorpdown using qtp....

Answer / lak

1) Create an array to capture all the Weblist items - call
it as appArray
2) Sort the appArray to display all items in ascending order

For i = 0 to UBound(itemArray)
itemArray(i)
Next

- Again there is no sort function which is readily
available. You would have to code for the sorting to
something on similar lines -

for i = UBound(appArray) - 1 To 0 Step -1
for j= 0 to i
if appArray(j)>appArray(j+1) then
temp=appArray(j+1)
appArray(j+1)=appArray(j)
appArray(j)=temp
end if
next
next

3) Save this as sortedArray. Compare some of your original
appArray items to the sortedArray items in terms of
positions.

If they are different, your verification is a fail and if
an exact match, its a pass.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

why don’t use real time they r not using check points

1 Answers   Wipro,


It is regarding VBScript, how to export our function results to ExcelSheet through VBscripting. Ex: I have written add function, that result should export to Excel.

3 Answers  


what is the difference between DP and keyword driven framework?

1 Answers  


how can i add an action(external action) programmatically?

3 Answers   Ordain Solutions,


how will load the object during runtime?

0 Answers  


How can we use the "CreateObject ("Scripting.FileSystemObject")" in QTP and what is the definition and purpose of it?

2 Answers  


What are the flaws in water fall model and how to overcome it?

0 Answers  


Explain the types of object repositorys in qtp?

0 Answers  


I am using excel sheet to export data to QTP but it selects just one row of data from excel sheel how to import all rows of excel sheet to QTP during runtime

10 Answers   IBM, Wipro,


in a database table there are 3 columns (name , marks,grade) , in application after retrieving data from db to fields name, marks click ok button then grade should displayed ---for this how to write vb script prgm

3 Answers   IBM,


Plz send one Tracebilitymatrix example? Anybody working on Realtime QTP Plz give contact deatils?

1 Answers  


Where we write the FUNCTIONS, in Expert view (or) in any textfiles like Notepad and save it in Library functions folder? How to cal that functions to our script? How to save that functions to Function generator?

3 Answers  


Categories