I have opened 4 tabs on the same browser using control + T (hot key) and navigation. Now I want to go back to first tab and execute certain actions and serially move on to second, third and fourth tab and close all the tabs one by one. How can I achieve this?
You can use windows shortcut for the same:
control+1 = to move to the first tab
control+2 = to move to the second tab
control+3 = to move to the third tab and so on…
Pls mark it as solution if it solves your issue.
You need to drag and drop and use application/browser activity and attach each tab, then perform the actions you want there
also you can rehuse multiple instances creating an output variable and passing to the same use app/browser
We also recommend to use the Go to URL activity instead creating lot of tabs using ctrl + T keys
Multiple ways…two of them
- Use the window titles to identify the tab and close the required tab or click on close
- Use the output of the first use browser where you would have opened the tab and pass them around to get the window details.each browser activity will give an outout variable type of uielement/browser which can be pased in the bext activities and use it instead of selectors again
Hope this helps
Okay, short key control+number is working for switching tab to first or second tab. Now I want to close that tab and do the certain number of tasks on the second tab as well. How can I close that finished tab only.
I have used loop to open multiple browsers. It will be tedious to set output for each tab (say 5). I might need to open 10 tabs using loop. Btw, how can i close particular tab only (first tab)
First switch to the required tab, then perform your operations and again send hotkeys Control+w to close the tab.
Mark it as solution if it solves your issue.
You can create a list of uielments and add those variables to the list…Then using index of list you can get each tab …which can then be used later to close the tab as you anyways need using index
how can I close specific tab only (say first tab only) and do my task in second task (same process).
you can use the navigate browser activity with close tab property set in action
wouldn’t it close all the tabs ? I want to close only first (one) tab.
Make sure you are in the correct tab, check the selector matchs the correct tab and it will close only the selected tab
The problem is all the tabs are of the same link.
@Samraat_Maharjan1 have you tried this?
after I closed one tab I couldn’t process same task in another tab because of selector issue
Do you have any documents or blogs for this (regarding uielement and index)? I am not getting your point. It isn’t very clear to me right now.
BTw can we sue this index of list using other loops (other than for each)?
This is what I am trying to explain
Basically inside your loop open each tab…and save the output uielement that you get to alist by adding the value to list…then later when you want to close you can use
ListArr(0) which will give the uielemnt for first tab…and then close it…using a click on close or close tab which ever workd…listArr(0) will give the first tab and can be passed in the input element field
when I created ListVar. it’s variable type is showing iList instead of list<Uielement< how can i changed that?
Click on browse for types in the variable field…then select
System.Collections.Generic.List and then from the drop down on the top beside list select browse for types UiPath.Core.UiElement