Hints, tips and tricks for newbies
Moderators: Dorian (MJT support), JRL
-
Sylvain
- Newbie
- Posts: 2
- Joined: Mon Jul 19, 2021 6:58 am
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
-
Grovkillen
- Automation Wizard
- Posts: 1131
- Joined: Fri Aug 10, 2012 2:38 pm
- Location: Bräcke, Sweden
-
Contact:
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.
-
Sylvain
- Newbie
- Posts: 2
- Joined: Mon Jul 19, 2021 6:58 am
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.