Micro Focus QTP (UFT) Forums
Different Type of Dropdown Selector - 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: Different Type of Dropdown Selector (/Thread-Different-Type-of-Dropdown-Selector)



Different Type of Dropdown Selector - zunebuggy - 04-11-2018

We are testing an in-house web app.  Most fields are WebEdit type, but the dropdowns are not conventional dropdowns.  They are made up of WebElement type objects.  For example, the "dropdown" contains the word Country and has a small down arrow (upsidedown triangle) next to it.  It appears as a typical selector type dropdown, but using Object Spy I see every part of this dropdown is a WebElement.  So I figured out if I used the .Click on the down arrow WebElement, I count the Country selection list to appear.  This works.

When I try this:

 
Code:
Browser("MyBrowser").Page("MyPage").WebElement("selCountry").SetTOProperty "innertext", DataTable("Country", dtGlobalSheet)
  

and my Global data Country column contains UNITED STATES, this does not select UNITED STATES from the list.  It does not error, but it does not select it.  My selCountry is the WebElement of the selection list and if I select UNITED STATES manually and use Object Spy on the UNITED STATES selected, it is the WebElement selCountry and the innertext property is UNITED STATES.  If I select another country, the innertext property is whatever I select.  Why can I not select this at runtime?

Thank you.


RE: Different Type of Dropdown Selector - zunebuggy - 04-11-2018

So something new I discovered. If I select UNITED STATES and use object spy on the UNITED STATES text I can add the object as a WebElement. Then if I select (for example) JAPAN, and do object spy I can now add this as a separate new WebElement. Each item in the dropdown list is a separate object. So please help me figure out how I can select (dynamically) a country from the "dropdown" when each is a unique object? I do not know how they coded this, but that is how it works. I hope I don't need a new plugin for this type of web coding.

Thanks again for anyone who can assist.


RE: Different Type of Dropdown Selector - Ankur - 04-12-2018

May be use Descriptive Programming and pass the country dynamically at run time to identify and select the country?


RE: Different Type of Dropdown Selector - zunebuggy - 04-12-2018

Are you able to provide an example?

I thought that I was doing that here:

Browser("MyBrowser").Page("MyPage").WebElement("selCountry").SetTOProperty "innertext", DataTable("Country", dtGlobalSheet)

when essentially this is the same as:

Browser("MyBrowser").Page("MyPage").WebElement("selCountry").SetTOProperty "innertext", "UNITED STATES"

Thank you.


RE: Different Type of Dropdown Selector - zunebuggy - 04-23-2018

(04-12-2018, 11:42 AM)Ankur Wrote: May be use Descriptive Programming and pass the country dynamically at run time to identify and select the country?

But I cannot do that because each country name in the list is a unique WebElement object.  I guess I could add every country to the Object Repository.  

This is the way they programmed it.  They are using some third party web app.  I may have to ask them what it is and find a UFT plug-in for it.  All the other objects act as regular object.  It is just the dropdowns that are not typical WebList type objects.


Thanks


RE: Different Type of Dropdown Selector - Ankur - 04-24-2018

Paste the relevant screenshots of Object Spy for web element with details on what is creating an issue in object identification.


RE: Different Type of Dropdown Selector - zunebuggy - 05-01-2018

(04-24-2018, 02:19 PM)Ankur Wrote: Paste the relevant screenshots of Object Spy for web element with details on what is creating an issue in object identification.

I hope I did this right.  I uploaded my screenshot to my Flickr account and got the URL and inserted it here as an image.