How to open new tab of the same browser

I want to open multiple new tabs (one by one) [say 5 for now] and execute specific actions: click, type into, etc, and submit each page one by one. Is this possible through UiPath?

This is much like a filling form by opening 5 new tabs and executing each tab(page) one by one.
PS: I know this activity (process) can be finished by using a loop (in the same tab) but I want to do it different tab because my process involves clicking certain events and it takes plenty of time to load certain click buttons that’s why I need to open multiple new tabs.

@Samraat_Maharjan

Please check this…

Hope this helps

Cheers

HI,

How about using InjectJSscript as the following?

"function(e,v) {window.open(v, '_blank').focus();}"

Sample20230313-2L.zip (222.4 KB)

Regards,

3 Likes

Hi @Samraat_Maharjan,

  1. Use the “Open Browser” activity to open a new browser window.
  2. Use the “Navigate To” activity to navigate to the website or page you want to open.
  3. Use the “Send Hotkey” activity to send the Ctrl+T hotkey combination to open a new tab.
  4. Use the “Attach Browser” activity to attach to the newly opened tab.
  5. Perform your desired actions on the attached tab, such as clicking on buttons or typing into text fields.
  6. Use the “Send Hotkey” activity to send the Ctrl+W hotkey combination to close the tab.
  7. Repeat steps 3-6 for as many tabs as you need to open and perform actions on.

Do I have to copy-paste the same code 3-6 times or can I do it using Loops?

@Samraat_Maharjan

You can do this in a loop and use variable for the url part which would be ideal to be used in the loop arguments as well…you can have a datatable with urls or a list of string type variable with urls and loop on them

Cheers

1 Like

The following worked for me in order to open two tabs with two different URLs - you could add a loop or copy/paste and adjust accordingly:

1) Inside a Sequence, add a “Use Application/Browser” Activity (Chrome) and inside the Browser URL field, I pasted between “” the 1st website link.

2) In the “Properties” section of this activity, I added an “Output Element” which is a variable called “strBrowser”, and then the following “Options”:

3) After that activity, the next one I added was a “Keyboard Shortcuts” Activity, and I configured its properties so that you don’t need to point at an application for it to know where to press the keys, instead, there is an “Input Element” property I defined with “strBrowser”, which holds the object created when we opened the first google chrome link, and then afterwards just sending the “CTRL + T” combination.

4) I added another “Use Application/Browser” just beneath the “Keyboard Shurtcuts” one, and the Browser URL field this time I set it to: “chrome://newtab/”

Then, inside the “Do” section of this activity, I added a “Go to URL” activity and just pasted between “” the 2nd link I wanted to access on that new tab generated on step number 3.

The “Options” I configured within this 2nd “Use Browser” activity are the same than the above shown in the image.

All of the above being said, this is the first scenario that works for me after reading for a while on this specific topic.

I wonder if this would work for automating a process which involve the use of multiple websites being open simulatenously and then executing certain actions on each tab and/or passing info from one to another - that’s still to be tested, but perhaps I will have more info. later when I keep adding on this activity.

I am fairly new to the forum and UiPath overall, but this is exciting stuff!! Thanks!