While testing for a certain web application, I was faced with an issue of handling auto-complete scenarios. An example of this kind could be found here MagicBricks
I have few questions related to how we are supposed to handle such auto-complete scenarios.
Suppose I am entering a search word in the search box like Gurgaon. How does the auto-complete get populated? Is this due to some JS function written at back or does it pick values from a database?
I am no champion at JS, but I can see that the the with id localityKeywordDropDown has a visibility set to hidden. So the drop down options are not visible without entering any value. If I am writing test for it, how can I wait for these values to get populated? Right now I can think of using explicit waits, where I can wait for element to be present (correct me if I am wrong).
Suppose I am entering a text- Gurgaon Sector 51, which is at the bottom of the key words matching Gurgaon. How can I verify that the search string that I have searched is present within that list (using some kind of assert I would suppose)?
I assume that a few of the questions might cross the boundaries of SW Testing, so pardon me if this is the case. Any resources, links, relating to how we can handle these kind of scenarios will be appreciated. I found one here Handling auto complete using Selenium and Python
But I'm not quite sure if I understand how that is working.