Micro Focus QTP (UFT) Forums
QTP 9.2 Checking values in a dropdown list - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: QTP 9.2 Checking values in a dropdown list (/Thread-QTP-9-2-Checking-values-in-a-dropdown-list)



QTP 9.2 Checking values in a dropdown list - Poonam - 09-25-2008

I am trying to automate an application which uses a lot of forms.
In the dropdown boxes on the form there are about 50-100 values.
What options do I have in QTP to test all values are there, during regression testing. In some of the dropdown boxes you have to select an option. The second dropdown displays values based on the option selected in the first. Will appreciate any help I can get. I am a new QTP user. I was thinking about datatables. Will those help in the scenario above?


RE: QTP 9.2 Checking values in a dropdown list - jitendranookala - 09-30-2008

Hi

First of all get the items count for that use getitems count
frame a loop.
then get an item from that list by using getitem(i)
i stands for the number in the list
after getting you can compare the object and write the result if you want.


RE: QTP 9.2 Checking values in a dropdown list - anusooya_e - 09-30-2008

Hi

If the order in which items display in your Listbox doesn't change then try this one .Initially Using object Spy get the property "allitems".
In your script store the info in the same format got above in a variable.Get the object's(listbox) allitems property using getroproperty in another variable. compare both strings. You will get true or flase.

Anu


RE: QTP 9.2 Checking values in a dropdown list - murali1201 - 09-30-2008

Hi below link may help for your question.
http://www.allinterview.com/showanswers/37219.html


RE: QTP 9.2 Checking values in a dropdown list - Poonam - 10-02-2008

Hi everyone,

Thanks for all your suggestions. I was just checking the posts today. Was expecting an email when a reply has been posted.
Anyways I tried creating a standard checkpoint for the WebList and checked the innertext property in the checkpoint properties. So when I run my test the checkpoint passes if the values in the list are the same. If a value is missing or a new value is added later(after recording) the checkpoint fails. Do you guys agree with this solution??


RE: QTP 9.2 Checking values in a dropdown list - vibhakhandelwal - 11-29-2011

My Question is related to the same post.
My Application is based out of Java. Where i have 2 dropdowns (where value in second is triggered based on first dropdown).
The problem i am facing is when i select the value from first dropdown, the value is not populated in the second dropdown when done using QTP.

When I do the same manually in my application i.e. I select value from the first dropdown, the values in the second dropdown populates 'onchange' of values in the first dropdown.

Please suggest me as to which method I should use in QTP ..with the help of that i can ask qtp to trigger values in second dropdown.
I tried the below methods but are not working .........
Code:
Browser().page().frame().weblist().fireevent"OnChange"
Browser().page().frame().weblist().fireevent"OnpropertyChange"