Browser output element conversion

Hi,
attach window is giving me browser output element.

I need to use it as input element for Use application\browser.
But Use application\browser input element is of type UIElement.
How can I do this? Please suggest. Thank you,

Hi @A_Learner

You can use the Output variable of Attach window activity to the Input Element to the Use application\browser activity.

No need to convert it will work.

So, we can use them mixed together as the following, for example.

  • Case for Browser instance which is output from OpenBrowser activity is used in UseApplication/Browser activity.

  • Case for UiElement instance which is output from UseApplication/Browser activity is used in AttachBrowser activity.

Hope it helps!!

1 Like

Why would you use Attach then Use App/Browser? Use App/Browser does the attach part for you.

Thank you, @postwick
Updates to legacy code.

Thank you,

will try this. Thank you.

1 Like

It’s my pleasure… @A_Learner

If you find the solution, make my post mark as solution to close the loop.

Happy Automation!!

If I use the output browser element as an input to use application browser, I am getting an exception HResult: 0x80040214

Could not use.

Thank you

It is working for me. Could you explain what you done or share the screenshot with me… @A_Learner

The code uses “start process” with url of the application.

Then it does some authentication and clicks on a link to open a new tab.

Processing is in the second tab.

Attach window, close tab (to close first tab.) This attach window gives browser output element.

I need to pass it to other workflows.

  1. How to fix this issue
  2. What is the best way of design for this to get the output UI element to pass to other workflows?
    Thank you

Thank you,

Okay @A_Learner

Can you try like this,
→ Use the Start Process to launch the Application by using URL.
→ Then use the Use applicaton\browser activity and indicate the application. Change the Window attach mode option to Single window in the Properties.
→ Inside this First Use application\browser activity insert the activities to automate the authentication part.
→ Then create a variable in the outputElement option in properties of Use application\browser activity, let’s call the variable name as OutElement.
→ Then drag and drop second Use application\browser activity give the OutElement variable to the Input Element option in the Properties.

Try this in a new sequence to check the flow.

Hope it helps!!

Thank you. Where does the close first tab go?

1 Like

It will automatically close after first Use application\browser activity execution… @A_Learner

Hope you understand!!

If you’re updating legacy code you should be getting rid of non-modern activities like Attach Browser and replacing them with the modern equivalent, which is Use App/Browser.

1 Like

Use Application/Browser opens it for you. Set it to close always.

Click the link, new tab opens. After the first Use Application/Browser you just use another Use Application/Browser (set to open never) to attach to the new window/tab.

If you need to pass the browser UI element to other things, just use the output property of Use Application/Browser.