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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Angularjs - Dynamic dropdown ids working with Selenium Testing

Thread ID:





123667 Apr 8,2016 09:28 AM UTC Apr 11,2016 11:13 AM UTC JavaScript 1
Tags: ejDropDownList
Rob ONeill
Asked On April 8, 2016 09:28 AM UTC

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.

Dhinesh Ravi [Syncfusion]
Replied On 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


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon