Posted: 7 Jul 2017 11:45 EDT Last activity: 6 Nov 2018 20:02 EST
Cloning list elements in a web application using OpenSpan
We have a web application, in which there is a unordered list with several list items. We are using the GetClones of the list element (the elements are matched using the style component in the inner html).
Majority of the times when we run the automation, the solutions gets all the clones and processes it. But every now and then, maybe 30% of the times, all the clones are not retrieved. It misses few of the clones.
Please let us know how this can be remediated. Is there any other step that we must be doing to prevent this from happening.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
It seems likely that you are proceeding before all of them have been matched. There is no WaitForCreate for a cloned control (i.e. wait for all of them to be created). For this instance, I have typically done the following;
WaitForCreate for the parent control of your cloned control.
Call the GetClones method of the control and extract a proxy.
Make sure the proxy is set to local scope.
Record the Count property of this object to a variable called lastCount.
Add a forLoop.
On the Yielded execution point of the forLoop, pause for some period (usually I use 500ms as my default).
Call the GetClones method of the control again and extract a proxy and store the count in another variable called currentCount.
Make sure this proxy is set to local scope.
Compare these two values.
If they are equal, then break the loop and continue.
If they are unequal, copy the currentCount value to the lastCountValue (the next iteration of the forLoop would happen next and pause).
Essentially what you are doing is checking the number of clones you have and waiting until that number is stable (has stopped changing).
Thank you for the inputs, but I have a follow-up question. What should be the maximum limit of the for loop mentioned in step 4. Is there any fixed count or would it be determined based on the actual experience seen during the execution?
Posted: 3 years ago
Posted: 11 Jul 2017 9:50 EDT
Thomas Sasnett (ThomasSasnett)
Lead Robotics Architect u2013 Pega Consulting