We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Angularjs - Dynamic dropdown ids working with Selenium Testing

We have an application were we dynamically create dropdowns inside an angular ng-repeat which is fine. The issue is that to get the dropdowns to work correctly, and have uniqueness you cannot use the 'id' property, so have to use ng-attr-id.
But doing this means there are no unique dropdown ids for the containers, such as "_wrapper" or "_dropdown" or "_popup_wrapper". Therefore when there are multiple dropdowns it is impossible for Selenium UI Testing to find the right _popup_wrapper, and therefore the list inside the popup.

Can you suggest a way to find the corresponding pop_wrapper for the correct dropdown?

Cheers ... Rob.

1 Reply

DR Dhinesh Ravi Syncfusion Team April 11, 2016 11:13 AM UTC

Hi Rob,

Thanks for contacting Syncfusion Support.

We have a property named as _requiresID in our source. When this property is set to true, it generates the ID for the control automatically using the prefix “ejControl-(index)”, if the ID is not provided for the control in the sample .

To set this property, we need to define it in the prototype of DropDown control. Refer to the following code example.



        ej.DropDownList.prototype._requiresID = true;


Note: This script needs to be set next to ej.web.all.min.js script reference.

We can use the ID “ejControl-(index)”[ejControl-0], to write the testing automation using selenium.

We have also modified your code example.


Dhinesh R

Live Chat Icon For mobile
Up arrow icon