Micro Focus QTP (UFT) Forums
How to create dropdown menu in QTP - 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: How to create dropdown menu in QTP (/Thread-How-to-create-dropdown-menu-in-QTP)



How to create dropdown menu in QTP - renjith.nair@wipro.com - 07-02-2011

Hi,

In my project, while starting the automation i need a dropdown that prompts the user to select one option from a set of scenarios which has to be executed. Say Automation Starts (F5 ) with the following popup:

Scenario Selection
---------------------
Please Select one option:

[Dropdown having content]

1) Addition
2) Substraction
3) Multiplication
4) Division

So what i need is the code to create dropdown in vbscript.
While googling, i got one thread like we can use IE instance for creating a dropdown. If so, please give me a demo code from which i can start exploring.



RE: How to create dropdown menu in QTP - rajpes - 07-04-2011

Well i can think of using a simple inputbox

choice=inputbox ("Enter your choice:"&vbNewLine& " Press 1 for Addition" &vbNewLine& " 2 for Subtraction" &vbNewLine& " 3 for Multiplication" &vbNewLine& " 4 for Division")

Select Case choice
Case "1":'call addition function
Case "2":call sub function
Case "3":call mul function
Case "4":call div function
Case else:msgbox "invalid choice"
End Select


RE: How to create dropdown menu in QTP - renjith.nair@wipro.com - 07-04-2011

Thanks for the reply.
But in my case, the selectable scenarios is greater than 12. Presently i've implemented this menu idea. But this menu thing is not feasible in my case. Please let me know if any ideas come up.


RE: How to create dropdown menu in QTP - rajpes - 07-05-2011

Then create a simple html file with that drop down and automate that page to be shown and capture the selected item in the dropdown and continue with your scipt with select case