Use the newly opened browser tab

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Sylvain
Newbie
Posts: 2
Joined: Mon Jul 19, 2021 6:58 am

Use the newly opened browser tab

Post by Sylvain » Mon Jul 19, 2021 11:29 pm

Hi,

I have been able to open a new tab by clicking on a link:

Code: Select all

ChromeElementAction>strSessionId,links_1,click
Now, it looks like the macro keeps working on the original tab, is that right?
Is it possible select the new tab to perform actions in this one?

Thank you

User avatar
Grovkillen
Automation Wizard
Posts: 998
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Use the newly opened browser tab

Post by Grovkillen » Tue Jul 20, 2021 10:20 am

A word of wisdom:

NEVER USE TABS FOR AUTOMATION!

The way that the browser is using tabs is a hack which is triggering to redraw the window when a user select a new tab. As far as Window is concerned there are no tabs. If you look in the "View System Windows" and use the crossbar to select a Chrome window you see that it will only show the active tab's caption etc. So for the sake of your script execute the Chrome command to open up a separate window instead of trying to go back and forth using tabs.
Let>ME=%Script%

Running: 15.0.24
version history

Sylvain
Newbie
Posts: 2
Joined: Mon Jul 19, 2021 6:58 am

Re: Use the newly opened browser tab

Post by Sylvain » Fri Jul 23, 2021 5:54 am

Thanks for the information.

So instead of that:

Code: Select all

ChromeElementAction>strSessionId,links_1,click
This enabled me to navigate to the page within the same tab:

Code: Select all

ChromeGetElementData>strSessionId,links_1,attribute/href,the_url
ChromeNavigate>strSessionId,url,the_url
from then I was able to perform the actions needed on that page.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts