'How to handle field select with search in selenium IDE?

I have 2 field with same element. I succeed in one field with this command:

Command:sendKeys | Target:css=div.Select-control input | Value: Brain${KEY_ENTER}

but I have problem in another field with same element. I don't know to location another field with same element.

screenshot 1

screenshot 2



Solution 1:[1]

If they both have the exact same locators, try using :nth-of-type() on the end of your locator to locate specific instances.

https://saucelabs.com/resources/articles/selenium-tips-css-selectors In the section titled Choosing a specific match

Another option would to be to use a compound locator, based on a parent element unique to the section of the page each field is on

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jsmith2800