Browser get the url on a New opening tab from click

Hello All,

My script due the following steps:
-open browser (Chrome) set output: “Get_Browser”
-Navigate to (Website) Browser : “Get_Browser”
-Click on a specific Hyperlink => Browser open a new tab

The new tab is now visible. And what I need is the url of this new tab and after close it…
But he get the url from the first Tab and also close Him no the second one

So it’s probably beceause my second tab didn’t have any variable, but I don’t know how to pass it

Sorry for my english…
Thanks

@Mathieu_Herbay,

I think that you will have to use Sendhotkey Ctrl+Tab which takes us on next tab.
when you’re on first tab use above activity and get url and close current tab(second tab).

Can you please try above solution? if you’re blocked kindly let us know.

Hello @Pankaj.Patil

Unfortunately no, when he click and open the new tab he already goes to the new one.
Even if I’m showing the good tab (tab2) he tooks the Url and close the first tab, it’s probably because my Get attribute and Close tab have for element the variable “Get_Browser” but what I should put instead ?

thanks

@Mathieu_Herbay,

Oh I see…
What activity are you using to close tab?

Just try… take send key Ctrl+w to close tab2 with selector of tab2. Let’s see how it goes.

@Pankaj.Patil

Just made a quick script to show you the problem
New Tab.zip (44.3 KB)

So as you can see even if you are on the second tab he close the first one…

Thanks

You can get the URL from the link with a Get Attribute, then just use that in an Open Browser.

Hello @postwick,

Did you open the link? because it looks like it’s what I’m doing… But you open a new entry in my head as: get attribute “href” instead click load new tab and get attribute “url”( this one doens’t work he give me the Url from the first tab)


But as you can see on the screenshot I didn’t have the possibility to copy it from a right click or get attribute “href” because the hyperlinck isn’t write in the code :confused:

Thanks,

When the new tab opens, use attach browser activity to attach to that tab (I’m assuming you know what the page title or selector is for that?).

Attach browser → output browser variable

image