How to make QTP recognize an element from sub dropdown list

Ayan Mukherjee's picture

When a value is selected from the dropdown the sub drop down list is populated in a field.QTP can recognize that sub dropdown list but cannot select a value from that list.

Even virtual object concept is not working. How to select (basically click)element from that drop down?

2 Answers

Mike Sparks's picture

Not sure how to do this with QTP, but it's something that Tellurium does on the fly, automatically (www.te52.com)

Yosef Connors's picture

I once had a sub-menu in a web application that was not recognized by QTP. I came up with a very barbaric method to select the items in the sub-menu. The sub-menu that i needeed was not going to change in the foreseeable future, therefor I created a function using cases for the number of items in the sub-menu.

Lets use an example. we'll use #2 as our case, meaning that we want to select the second item in the sub menu. Calling another function(you'll use it a lot) that uses sendkeys to imitate the users click of the Down key and the Enter key. Therefor, the number of presses to the down key = 2(acording to the id of the case) and Enter one press.

Again this would really only be good if the sub-menu is not supposed to change in the foreseeable future, otherwise maintaining the code would be a big waste of time.

Hope this helps, good luck!

Yosef

StickyMinds is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.