cancel
Showing results for 
Search instead for 
Did you mean: 

How to search and select value from dropdown of web application

Highlighted
Occasional Contributor

How to search and select value from dropdown of web application

I have recorded keyword test for dropdown with search. I have enter value and selected the value from dropdown in recording. i want to loop that recorded script so i use dataloop. my script is enter value to search and select that value and then add. but for second value it get failed. so i want to search and match that value and select that value. pls help me achieve this. 

5 REPLIES 5
Highlighted
Community Hero

Re: How to search and select value from dropdown of web application

Can you share what you have done already to-date?  Give us a screenshot of what you have recorded.

 

You say it "failed".  What happened? What error message did you get?

 

Also, review the following.

https://support.smartbear.com/testcomplete/docs/keyword-testing/basic/data-driven-loops.html


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

Re: How to search and select value from dropdown of web application


error.pngerrorscript.png

Highlighted
Community Hero

Re: How to search and select value from dropdown of web application

Generally speaking, what I'm seeing is that the problem is not in the loop itself but in the object identification for your various components.

 

1) You have the "Extended Find" turned on for automatic mapping.  While Extended Find is a good feature, it can cause a LOT of confusion in your mapping and can increase execution time.  Go to Tools | Options | Engines | NameMapping and uncheck "Use extended find when possible".  This will prevent using that flag moving forward.

 

2) The object you have mapped as "Link" probably was mapped based upon the first item you selected.  You should examine the mapping properties of that object and adjust them to be less specific to the individual item and more generic to the link on the page.  You may need to do some work where you're not going to map the individual links but use a FindChild to find the desired link based upon your data driven loop.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

Re: How to search and select value from dropdown of web application

Can U pls elaborate it with practical example with steps. What operation should i use from testcomplete for to find child?

Highlighted
Community Hero

Re: How to search and select value from dropdown of web application

Hi,

 

From the test log provided, it looks like the first loop iteration passed successfully and the problem occurred on the second iteration. Most probably, the root of the problem is not the error message but the warning one above the error.

'Ambiguous recognition' warning means that more than one object matching namemapping recognition criteria was found during the search.

Your practical steps may be like this:

-- Read for details the information in the Additional Info log pane for the 'Ambiguous recognition' warning;

-- Investigate your tested application with Object Browser/Object Spy and find those objects that were identified as 'link';

-- Make a decision if it is OK for your application to have more than one 'link' object at the given moment of time and for the given application state. Report an issue to development if it is not;

-- If it is OK to have more than one 'link', then investigate their properties and adjust your NameMapping so that only one required object was identified as the 'link'.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
A new challenge is here!

Create a function to drag one element to another for the TechCorner tag!

Will you dare to take the challenge?


Scripts created in July:
- Passing custom command-line arguments as a test parameter
Top Kudoed Authors