Hi,
> I am sorry to bug you again and again
That's OK with no problem indeed. We all here are trying to help when we can. 🙂
Also SmartBear's Support is really helpful and can be contacted via the https://support.smartbear.com/message/?prod=TestComplete form in case no one here can help.
> I am not able to find unique identifiers for these two.
This is the usual, common and generic problem of the majority of modern web applications created using modern libraries/technologies when testability is not considered on the design stage and is not specified into requirements. A lot of people here have this exact problem. Unfortunately, React and Angular are great examples of the libraries that by default produce barely testable web applications.
Obviously, the best and the most reliable way is to talk to Development and discuss with then the possibility to provide *stable and unique* identifiers for all web elements your test code needs to interact with.
Unfortunately, this might appear to be not achievable depending on the project.
The good news in this case is that more than one property can be specified as a search criteria for the .Find() method. For example, you may consider something like this:
let memberdragFrom = page.Find(["class", "index"], ["*name cdk-drag*", 2], -1);
to search for the web element with index that equals to two. For sure, as index is dynamic property, this approach is less stable and reliable when compared to unique identifiers like ID, but might appear to work for you.
So, again, examine the required web elements in the Object Browser and identify set of properties that are stable enough and make it possible to uniquely identify the required web element and use these properties and their values as a parameters for the .Find() method.
P.S. Consider the search not from the page root but from some intermediate container. For example, the source and target web elements (those you are dragging from and to) may be a children of different panels. If these panels are easily and uniquely identifiable, it might be more easy and more reliable to find those panels first and then search for the required web elements not from the page but using found containers as a search root.
Sometimes, such approach, combined with some simple math and tested application's specific may result in more reliable test code.
For example:
-- If Medical Group #1 and Medical Group #2 panels can be reliably identified;
-- You may search for all 'cdk-drag' web children for each panel;
-- The first (or the last) found element for every panel may be the sub-panel that the dragged element should be dropped to;
-- And the second (or the last but one) found element in this case may be the element that that can be used for dragging.