mardi 22 décembre 2015

Django - Selecting Autocomplete-Light choices with Selenium

I've been trying to figure out how to select an option from a drop-down created by autocomplete-light for my tests.

The responses here did not work, and seem to be out of date.

I also tried an option from autocomplete's code.

I boiled down the code to this: self.selenium.find_elements_by_css_selector('.yourlabs-autocomplete[data-input-id="id_branch-autocomplete"][data-value]')

where id_branch-autocomplete is the name of the field where data is being entered. However, it returned an empty list.

Has anyone been successful at this? I can't seem to find the element that appears in my browser's console and I don't understand CSS well enough to extrapolate the proper selector from the files.

Aucun commentaire:

Enregistrer un commentaire