Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Highlighted
Absent Member.. vzamoraz Absent Member..
Absent Member..
265 views

QTP/UFT support tip: How works with not supported combobox

There is a workaround that can be applied when a combobox is not recognized by QTP/UFT.

  1. Open QTP/UFT loading the Web Add-in.
  2. Open the Object Repository
  3. Click on “Add to Local” Button
  4. Add the arrow object of the combobox

5. Click on Add to local again from Object Repository, Keep the “Control” Key pressed meanwhile you perform the actions needed to show the options of the combobox.

 

6. Stop keeping the “Control” Key pressed and click on the option you want to add it to the Object Repository.

7. Drag and Drop the arrow object from Object repository to the Expert view and change the method to .Click

You will have in code something like:

Browser().Page().WebElement(“arrowobject”).click

 

After that Drag and Drop the option object from Object repository to the Expert view 

You will have in code something like:

Browser().Page().WebElement(“Option 3”).click

 

In this way QTP will click the arrow button to display the list and then the Option 3 element will be clicked selecting the option you want.

 

Note:  Also you can make this dynamic in order to avoid add lot of elements into object repository in case you need to select random or different elements.

You just need to change during Runtime the innertext property of the option element with the text of the option you want to select.

 

In the sample below test will choose option 3 since that was the element added into the Object Repository, If you want to select option 1 you can do this:

 

Browser().Page().WebElement(“arrowobject”).click

Browser().Page().WebElement(“Option3”).SetTOProperty "innertext","Option 1"

Browser().Page().WebElement(“Option3”).click

 

 

HP support
If you find that this or any post resolves your issue, mark it as an accepted solution.

 

 

Note: The Opinions expressed in my post are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any answered posted.

Labels (1)
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.