HRESULT E_FAIL Error - Get Attribute

I’m currently getting this error: “Get Attribute - ‘aaname’: Error HRESULT E_FAIL has been returned from a call to a COM component”. I’m selecting from a drop down list. What it’s supposed to do is to select the item, and click on ‘Go’ button which loads the page I want to download. Then it should go to a loop, selecting each item and so on. I’m using Find Children, then For each loop, then get attribute, then select item. The error happens after the first one on the list is processed.
I’ve been looking everywhere and can’t seem to find the solution to this problem. Please advise. I’d really appreciate it!
Thank you!

Kindly have a view on this thread for more insights

Cheers @martsantos

Thanks for responding.

I’ve tried everything that was suggested on that thread and no still no luck:

  • delay
  • .Net Framework uninstall/install
  • move UiPath project folder and cleared the screenshots
  • Currently using I.E. I’m not gonna be able to switch to other browsers due to requirements.

is there another way to get around this? Basically the way it does is it selects the item from the drop down list, and clicking on the Go button to load the page I will need to download. Then loop. The page I want to download is in the same page where the drop down list is located. I’m just wondering if there another way to process this if Find Children and select item don’t work. I’m getting the issue at the Get Attribute activity.
Please advise. I really appreciate all the help.

So you are using Get Attribute by passing the item of the loop as Target Element? do you have everything else there empty? and you are sure the attribute you need is there?

Yes. Find Children - saved to a collection. Loop within that collection to get the attribute (‘aaname’) then select the item.
It works fine with the 1st one on the list. It selects the item, hit ‘Go’ then the page loads then download the html page. Once that’s done, it should go to the next item on the list, and that’s where the error occurs. Get Attribute - HRESULT E_FAIL.
Not sure if there’s another way to accomplish this if ever this activity doesn’t work.
I appreciate the help @bcorrea , @Palaniyappan

so it must be because you are not waiting that reload to complete…

i already placed a delay activity right before the ‘Get Attribute’.
What happens on the page is once you hit ‘Go’, the page loads on that same page where the drop down list is located. Just wondering if that refreshes the components that was initially saved in the collection, thus causing this error?

that would happen for sure, if it reloads then you lose all… objects from children activity…

Hi @bcorrea,

I have the exact same problem as described. What is the workaround for this (losing the objects from children activity)?

Hi, welcome to the community!
Then you need to have the find children, after you reload the page…

Hi @bcorrea,
Thanks for the welcome and the quick reply. So would the solution be to first find the children and save them to a datatable, and then loop through this datatable so it doesnt lose the children?

No, this is exactly what you should not do… if you save the items and they change in the application, you will get the error…

Hi @bcorrea,
I am still struggling how to correctly solve this, can you help?

I have a dropdown list where I have to select a region from a list of regions, I select the region and click onto the next page where I perform some actions and then return to the page where I can select the region again. I need to loop through all the regions in the dropdown and perform the same actions.

How do I loop through all the regions? You said before that I have to find the children again after reloading the page? Thanks in advance

If every time you change a region on the dropdown, the page reloads, then you will need to call the find children again before using the items inside it…