How to record the titles of all tabs in the browser?

i just want to perform activities in 2nd tab, please help
@Nithinkrishna @lakshman

@Mystical_Devices May I know how many tabs you have to automate in your process

Only 2 in total

i just need help in traversing across 2 tabs and performing activities in them!
Perhaps u can edit my code and show me how,

Hi @Mystical_Devices,

You can do a lot with the modern experience, but I understand it is difficult to navigate and understand it.

image

Three ways to achieve what you want

  1. Classic activity which you shared in your .xaml
  2. Modern activity and bunch of shortcuts and string manipulation
  3. Inject javascript activity to do everything in Javascript, which will result in the best execution time, but will also take more development and testing time.

I have edited the project settings locally, so ensure that you do that before running the suggested approach.

Use the Chromium API in your properties:

Here is the file :
BrowserTabManpulation.xaml (40.2 KB)

Shortcuts :

Move between tabs – Ctrl+Tab
Get URL from address bar – Ctrl+L
Copy – Ctrl+C
Paste – Ctrl+V
Within a tab – Tab

The command string.join("/", Url.split("/"c).take(3))+Href changes the endpoint of the url in Wikipedia to the target element you clicked. We do this by getting the href from target element and url from the parent page and combine them using join, split and take methods

1 Like

thank you for replying,
i dont understand why we are taking the Href attribute, why not simply get the url attribute and paste in new tab?

anyways i tried taking the URL of the button into the new tab, but my URL is dynamic,
if i press the button it will automatically open a new tab, with the correct page,
however if i use the URL from get attribute, and make a new tab using shortcuts it does not take me to the correct page!

this is why i just want the following:

  1. after i press button in the main tab and the 2nd tab opens-
  2. i want to perform activity in 2nd tab, and thats all!
  3. how can i achieve this using modern or classic acitvities?

oK, please ignore the last part, using ur Href method- the link opens fine on the new tab, however!- it jumps back to TAB 1, and i tried using Control+TAB, shortcuts to switch- but it does not switch!- why?

i even use the click activity to select 2nd tab, but it wont budge, please advise
@jeevith

Hey @Mystical_Devices

Which browser are you using here please ?

Thanks
#nK

i m usung chrome

1 Like

Hey @Mystical_Devices

Thanks, will share you a sample soon.

#nK

Hi @Mystical_Devices ,

We have understood that the First Page would always be the Below Page Shown :

Next Step is to Click on the link highlighted, But is it the Only Click that needs to be Performed, or do you have to find the links present in the Page one By One and Click and Open New Tab and perform the operations ?

or

Is it only One Tab being opened up i.e Business Process Automation and we only need to perform operations on that after we have Clicked the link ?

Hi @Mystical_Devices

That is because the selectors in the hyperlink of Wikipedia links has url attribute of parent page and href of target page. If you use the URL attribute, you will end up opening the same page. See the UiExplorer below.


May be this is different on the webpage you are working so it is upto you to check if you need extra string manipulation or not. If your URL is dynamic, you do not need to click either. You could use Ctrl+T to open a new tab and then Ctrl+L to go to address bar and paste your target url (dynamic url) + Enter.

Once the new tab is open. Use the keyboard shortcut activity within the Ctrl+Tab Open application/browser activity.

An approach which your other website might support :

I do not like the right click here as the dialog window of chrome is subject to screen resolution and anchoring it is not so robust. But I think you get the point on how to get this done in the modern activities. Both of the approaches I have in this thread will work, provided you adjust it to your target website and here I am assuming wikipedia was just a dummy website you wanted forum members to use as a case.

The previous approach is commented out:

BrowserTabManpulation.xaml (54.3 KB)

The third alternative is (I dont have it in the .xaml)

  1. Open Your parent page
  2. Click on the button
  3. Use Ctrl+Tab to go to the new tab

Right,
so here is what i tried:
i pressed the button- a new tab automatically opens and after 1sec it goes back to the original tab.
so now i used a CTRL+TAB shortcut to go back to the newly created tab, but it does not go, i even tried CTRL+PageDwn shortcut, and it does not move to the new tab.

1 Like

Hey @Mystical_Devices

Kindly check here for the demo workflow,

It works fine for me, Check from your end.

nmnithinkrishna_UiPath_BrowserTabs.zip (3.0 KB)

Hope that helps,

Thanks
#nK

It’s important to understand that browser tabs are seen as separate windows.

If Attach Browser is not visible, that’s because you’re in modern. Don’t turn off modern. Don’t set the filters to see classic activities. Use the modern activity that replaced Attach Browser - Use Application/Browser.

But that’s not how you do what you want. To do what you want, you use Find Children. Set the selector to something generic like <html app="chrome.exe"> and it’ll return an array of all browser windows/tabs that you can loop through and use Get Attribute to get the title.

1 Like

Does this Activate window work on modern activity as well?

1 Like

yes @Mystical_Devices, it will. That’s not mandatory. But better to use if you want the screen to be visible else it will just work background.

Hey @Mystical_Devices

Please let us know, if you face any challenges.

Thanks
#nK

Use Application/Browser has an activate feature built into the properties.

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