How to switch between two tabs with the same title?

Hi, all
it’s good to find a community like this and such a nice and fast implementation script like Kantu

I have a problem with the selectwindow command
tab= setting isn’t helping a lot, i like the title= attribute much better but i bumped to an issue where i have three tabs open and i have to switch between then

The first is OK, nice with title but the other 2 have the same title
I always start kantu from the first tab so that i can be sure that tab 1 and tab 2 are correct but sometimes at the script i instruct kantu to open a page and then i get errors that there is not tab 2
It’s frustrating to have a headache with such a minor issue of window selection

Is there another way to selectwindow by title or somehow specific and not vague with tab 1 and tab 2 approach ?

UPDATE : I just found these links, i don’t know if this works , looks very relevant
The first i will try it, the second i didn’t understand it

Can you assign your own name for each tag as theses resources suggest, if you do how since i got all errors when i tried to replicate the solutions below

As a workaround, can you change the Window title of one tab? Then each window (tab) has a unique name:

Use this:

{
  "Command": "executeScript",
  "Target": "document.title = \"ABC\";",
  "Value": ""
},

While the focus is on the tab 1 (for example) i execute your suggested command and i get
Error in executeScript code: ABC is not defined

Where i define it ?

Try now, I edited it. “ABC” should be in “”, as it is a string.

1 Like