Clicking the correct chrome browser tab

Dear Experts,

Seeking your knowledge with an issue I’m having.

I have made an automation where I open a chrome browser, and through a click in the first tab (tab 1), the browser opens a new tab (tab 2), where the rest of the clicking will be done.

However, when I try, as next step, to click an item in “Tab 2” the browser switches back and tries to click in “tab 1”

I’ve tried using editing the properties of the click in the second tab, by changing the name of the tab (removing the full number and replacing with joker sign *) but when I do that, the UI robot can no longer find the element.

I tried using the keyboard shortcut CTRL+TAB and even CTRL+2 to select the tab, but whatever I do, the restult is the same:
1: If I have the “full path” in the "windows selector (Application Instance) the action will be done in the wrong tab
2: If I use joker characters, the UI robot cannot find the element.

I’m really at a loss here.

Is there any way I can close the “Tab 1” so I only have “tab 2” open or do you have any other suggestions?

To enhance my expanation I’ve added a few screenshots of the details of the tabs and the error I get.

I thank you in advance for any help or tips you can give me.
Image 1: The error message I get when the Robot cannot fin teh element
Image 2: The propertise os the “tab 2” with the full case number, that, albeit the robot finds it, it clicks in tab 1
Image 3: The propertise for tab 1

1 Like

A lot of the exact behavior will depend on the names of the tabs (i.e. whether the robot thinks they are “close enough” or can tell them apart with the default settings). Here are some general things to try:

  • After your automation opens the second tab, add a second “Use Application/Browser” and indicate the new tab. If needed, you can then tweak the properties to get a specific match to this tab vs. the first one.
  • If you need to, you can close the first tab using the “Navigate Browser” activity and selecting the “Close Tab” action.

Thank you Andrew for your suggestion. I had also wondered about closing the first tab and I will try that as well as your other suggestions.

These days the workload here is high so my time is rather restricted when it comes to programming the robots but I will get back to you once I’ve tested it.

Thank you again for your suggestions.

I am using StudioX with Firefox and my 2 tabs are differently named. One is ‘Cisco Webex Control Hub’, the other is called ‘Webex Calling’.

Have you actually been able to make this work? In my instance it just keeps resorting back to the 1st tab.

@BrettWentworth, I’m trying to replicate this behaviour. What UIAutomation package version are you using? And how does your windows selector looks like? User Browser Firefox … → Properties → Unified Application Target → Selector. Thanks

Hi. I am using StudioX 2020.4.3 but it regularly hangs my server and it takes me ages to get my IT to kill off the app.

@BrettWentworth can you try upgrading your UiPath.UIAutomation.Activities package to either the latest Enterprise version (20.10.9) or the latest preview (20.12-preview)? Studio → ManagePackages->Search for UiPath.UIAutomation.Activities->Version-> and let me know if it functions properly after upgrade? If still not, could you please provide the window selector: User Browser Firefox … → Properties → Unified Application Target → Selector. Thanks

Hi there, I have the same problem. Im now closing the first tab, but robot can’t find element in the new tab. I need to click on the download arrow. Please help.

Add idx='2' in the end of the first line of the selector.
image
If you will open more one tabs, you can use a variable instead of ‘2’.