How to prevent Find Children elements from being lost after another page is loaded?

I’ve been struggling with this issue for days, and still don’t know how to overcome it.
Is there any option to store somewhere these 17 children, so they cannot be lost after another webpage is opened(loaded)?
Thanks in advance!

Yah we can store them in a list variable
Like pass that ienumerable variable to a for each activity and change the type argument as uielement

Inside the for each Activity use a ADD TO COLLECTIONS activity where pass the collections variable as list_input and items as item
Whew list_item is a variable of type System.Collections.Generic.List(uielement) with default values as New List(of Uipath.Core.UiElement)

This will be low stored on tat list variable with which we can even add few more

Cheers @bp777


Thank you @Palaniyappan, but seems like this doesn’t solve my problem.
I’m still getting The UiElement is no longer valid error, so elements are however lost again :confused:

1 Like

Kindly elaborate the process a bit more pls

Cheers @bp777

Hi @bp777,
The best solution for your initial query is what @Palaniyappan said. and the reason why you still get the The UiElement is no longer valid error is because of the dynamic parts in the selector. As per @Palaniyappan’s solution you are storing the selectors, but when the page got refreshed, the selectors may get modified.
Try to print the selectors and check whether the selectors are same each time. and also make sure that while using those selectors, the corresponding elements are loaded in the browser.


@Palaniyappan @shankm
So, I will try to elaborate my case as best as I can.

So, on the Home page, there are links I need to open in order to scrape everything from each link.

First thing I tried is to use Data Scraping method, so I can get URLs and then to navigate through each link, one by one. But there is a problem - there is no URL available on the website I’m working on.

Second thing I tried was using Find Children activity, but there is another problem - elements of Find Children activity are lost, because links on Home Page cannot be opened in New Tab.
So, in my case, I don’t even use selectors :

Now, I don’t even know if I can use some totally other activity so I can finish my task? :confused:

What you guys think?
Thanks in advance.