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.
Unfortunately, activation email could not send to your email. Please try again.

Angularjs - Dynamic dropdown ids working with Selenium Testing

Thread ID:

Created:

Updated:

Platform:

Replies:

123667 Apr 8,2016 05:28 AM Apr 11,2016 07:13 AM JavaScript 1
loading
Tags: ejDropDownList
Rob ONeill
Asked On April 8, 2016 05:28 AM

Hi,
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 07:13 AM

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.

[html]

<script>

        ej.DropDownList.prototype._requiresID = true;

</script>


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.

http://jsplayground.syncfusion.com/dfuyk5km



Regards,
Dhinesh R

CONFIRMATION

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.

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.

;