Hi so I am building a bot that iterates through a number of select menus, and after all of the select options are chosen, a button is clicked and queries the database and the page reloads and displays a data table that I wish to extract data from. Iterating through the select menus is working fine, but when I add the click activity which reloads the page and returns the data table, it appears that I am losing all of the results of my find children activities. This is how the project is structured:
Find Children - from select menu (IEnumerable UiPath.Core.UiElement)
For Each (UiElement)
{
Get Attribute (aaname) > saved as string
write line
save as data row
click (button)
}
after the first iteration the page reloads and displays the query results and then I lose my IEnumerable from find children activity. I know that the problem is not because of the indication on the screen or the anchor because it worked perfect before I added the button that reloads, and that it has something to do with clicking the button to reload the page. It appears I lose all the find children IEnumerables and they cannot be passed to the Get Attribute Activity after the first iteration and page reload. What is the mitigation for this? If I call another find children activity at the beginning of the for each, then it will start over at the first option, and if I do a delay activity, the length of time varies. Any suggestions?
Probably because itās not recognized as same UiElement after reload.
So, as workaround, if the page structure is same after reload, can you try selector string instead of UiElement, as the following?
I tried all different types of variable types and it doesnāt like my function for some reason, can you tell me what Iām doing wrong? Thank you so much for your help itās my first time working with functions in UiPath Studio
it is c#, is it my data types? this is exactly what you posted as the formula, the find children activity is IEnumerable, and the assign activity outputs UiPath.Core.Selector, but I tried String array for find children output, and a couple others and still nothing. Thank you
arrSelector is string[] type. Then set it left side in Assign, and set children.Select(u => u.Selector.ToString()).ToArray() in right side as the following.
Ok so that fixed that problem, but how am I supposed to use the get attribute activity with the Array if it only takes UiElement? I have to use the get attribute to access the individual optionās inner text right? Thank you
without the get attribute, the itemRegion in the for each looks like this.
If there is a way to only select the aaname in the UiExplorer (in the ss its āAmericasā), then that would be ideal if it can survive the page refresh, Iām looking for some way to do it in the UiExplorer nowā¦casting the string to UiElement in the foreach TypeArgument does not work either
Ok Iāve been looking and trying to find a way to pass only the āaanameā to the selector array with no luck, I cant do it through the UiExplorer so it looks like I need to use the get attribute to access aaname, but get attribute only accepts UiElement, so the selector array can not work because it is declared before the for each, and now I am back to square one because I need the data structure to survive the page reload. Does anyone else have any idea on a solution? I canāt find anything like this, should I try putting the select options in a datatable? Wil that survive the page reload? I am thinking that datatables do not survive page reloads because none of my data rows are written after the reload when I step out of the for each. There has to be some way to deal with this use case right?
Hey again, thank you so much this helped me figure out whatās going on. So we have 2 different Get Attribute activities. I have a brand new version of UiPath Studio, and my foreach is iterating through strings
my Get Attribute activity is from
And this Get Attribute only accepts UiElement as input.
I am able to copy and paste your get attribute element, but am I missing something? I am not able to search and find the Get Attribute that you have. How can I fix it? I do not only want to use Get Attribute for UiElementā¦thank you so so much for your time