Error after using "Navigate to" activity

I have been encountering the “Error HRESULT E_FAIL has been returned from a call to a COM component.” using the Get text activity after the “Navigate to” activity.This is during the assignment 1 of the Level 3 course.

I am looping through a series of URLs stored in a datatable. For every execution of the loop, I attach to the browser and navigate to the page successfully, but encounter this error. Without the navigate (when testing separately), the get text works fine.

I am using IE as my browser, and since I use windows 10, .net is integrated into the system. Any help would be appreciated.

Hi @Alistair_Bangera

Refer the below post

The attach browser which you are having is having generic title or any specific title, help us with the selector of attach browser.

Thanks for the reply @anil5. I am now using a browser variable. But the same error persists. I am testing this out with a simplified workflow, and I will provide the details below.

Step 1: Open Browser - will open and login to the acme site.

Step 2: The attach browser that holds the navigate activities to individual product pages and associated get text. There are 3 navigate statements and screen scraping after each navigate.

How the navigate and screen scrapes look like:

Always, the first navigate and scrape works fine, but the second onwards throw the “Error HRESULT E_FAIL has been returned from a call to a COM component.” error. Baffled by this. Is there some kind of resetting that needs to be done after every screen scrape?

In addition, just for testing sake, i tried the following.

  1. Open browser

  2. Navigate

  3. Scrape

  4. Close browser

  5. Open browser

  6. Navigate

  7. Scrape

  8. Close browser

  9. Open browser

  10. Scrape

  11. Close browser

When using the above, the scrape works perfectly. So was wondering if this is something to do with resetting of the browser or something.

Hi @Alistair_Bangera,

The error is because of attach browser, can you remove attach browser and try.

Only navigate to activity and browser variable.

Because attach browser is expecting the start of screen, but after first navigate it lands on a different page and when attach browser and navigate comes the attach browser is expecting the first window where you have indicated the screen.

Thanks @anil5 , I removed the Attach browser, but the Hresult error still persists.

For testing, I just kept 1 navigate activity in the start, and used anchor to scrape 3 times. It worked. But when I use the navigate activity the second time, the get text activity fails. So I think the error is caused because of the navigate activity itself.

I even re-installed Uipath studio, cleared browser cache etc. Still the hresult error persists after the second navigate.

Can you help us with the selector of Attach browser

As suggested by you, I am not using an attach browser currently. But here is the selectors of the Find element inside the anchor activity. Since I am using the browser variable from Open, no other selectors are used in the flow.

Not find element, provide me selector for Attach browser which you were using before

Oh ok, I just checked the commented out Attach browser. I wasn’t using any selector on it, as I was using the browser variable from ‘open browser’ in the ‘attach browser’.

Can you use attach browser and provide the selector

Here is the selector that I was using on the attach browser, before using browser variables.

This time can you use attach browser and remove the browser variable and in the selector for title=‘Acme System 1*’ and give a try.

Tried it, its throwing the same error :frowning:

Send across your simple .xaml file. I wold like to test it out on my system once.

Thanks @anil5 for the resolution. The find element was causing the error. Just having the get text without the anchor makes the code work.

thanks @nadim.warsi. Have sent you the details. Though my code is now working after removing the find element and anchor and using just the get text as advised by @anil5.

Hi @Alistair_Bangera,

There was no issue with Navigate to its working perfectly fine, the issue was with Find Element and your get text.

I have removed find element and get text and have put only get text activity and please find the expected result.

I have extracted the values for only one navigate to you can perform the same with others and one more thing i dont have these workitems so change to yours



This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.