Handling multiple browser Tabs

Hi Everyone, Could any one help here,

Scenario: While I am trying to perform click or typeinto activity in the second browser tab facing the below error.
Attach Browser: Invalid selector: . Expected a selector. Please make sure that you indicate a browser tab element.

1 Like

In attach browser activity you can see indicate element right
Click on it and indicate the region of window where it has to interact with elements

Hope this helps

Cheers @Saajan_Venkatraman

@Saajan_Venkatraman

Looks like you have used full element sleector in the attach browser

ideally you need to have the wnd line alone and not everything

cheers

thank you for your response, I have tried the same but facing same error

Thank you for your response, That scenario I have tried in that case its navigating to second screen and after automatically its going to 1st browser tab

First would recommend to try indicate for ATTACH BROWSER activity
Reason is each window will have unique selector

U can find a blue text in that activity
Click on it
And indicate the region of scope

Then this work for sure

Cheers @Saajan_Venkatraman

@Saajan_Venkatraman

You ahve to use attach window if you are giving a wnd selector

ideally for any html page you will get the first selector as html and not wnd…please re indicate properly or use attach window instead

cheers

Hi same I have tried but after navigating second window its automatically changes to 1st browser tab and the next step element was not found due to its changing to 1st tab

Hi Anil, Thanks for your response, Did we need to indicate the top browser tab or need to indicate any fields in second tab?

Fine try re indicate for click activity again and try

If that doesn’t work

if u gave the url if the second tab
Then try to go to the new url
https://docs.uipath.com/activities/other/latest/ui-automation/n-go-to-url

Then try accessing it

Cheers @Saajan_Venkatraman


Hi same I have tried but after navigating second window its automatically changes to 1st browser tab and the next step element was not found due to its changing to 1st tab

@Saajan_Venkatraman

For attach broswer you need to indicate the whole window

for click or other activities you need to indicate the exact element

cheers

its automatically changes to 1st browser tab and the next step element was not found due to its changing to 1st tab

its automatically changes to 1st browser tab and the next step element was not found due to its changing to 1st tab

@Saajan_Venkatraman

  1. are the same elements present on first and second tabs?
  2. are the tab titles same?

idealy if any of above is same then it moves to first tab and its not advised to use multipel tabs

cheers

No both are different Anil.

@Saajan_Venkatraman

Can you show both selectors and both screens

cheers

Hi,

Can you try to use UseApplication/Browser activity with the following settings instead of AttachBrowser or AttachBrowser?

Indicate 2nd tab of the browser.
Open property : Never
Window Attach Mode : Single window

Regards,

Hi,


I have tried the same, but in this case bot clicks on 2nd window but after that automatically changes back to the first tab.

HI,

If we put click activity inside 2 UseApplicationBrowser activities, it’s necessary to choose proper target as the following.

Also check Windows Selector is same as target browser tab title.

image

Regards,