Switch to new browser window

The flow is:
Flight search and payment.
While execution at payment screen we have to click on frequent flier program which opens a new browser window.
Could anyone please guide me here ?
How to switch to new browser window and enter login credentials and finally sign in.
Tried… get comtext ids and switch to ${Context}[-1]
@damies13 @René @Tattoo Browser Browser-Dev

@Mtest6835 Just to clarify, do you want to switch to a newly opened tab? If so you can use

Switch Page NEW

1 Like

Hi @falcon030 tried…unfortely its not working

So it’s not a tab, but a new seperate browser window?

Yes its a new browser window for login…and it automatically closes once i provide credentials and click submit.

What do you see if you add the following lines to your code after the new browser is opened? Maybe preceded by a sleep 4s, to make sure the new window is opened before running the code
${browser_cat}= Get Browser Catalog
Log To console ${browser_cat}


This is what i see.
All Context Ids :: this line is getting printed as I have added statement for that. So you can ignore that please.

I need to Switch to this “Login To Emirates”

Getting Below Error while trying the code:

ValueError: Malformed page id: browser=513cc217-3727-4c59-acfb-6a5876b51ebe

What strange is, is that the first browser from the catalog, has no open pages?
What happens if you use the following code, instead of the code the shows the browser catalog, to switch to the new window?

sleep 4s
${page_ids} Get Page Ids
Switch Page ${page_ids}[-1]

This code works for me after opening 2 different browsers (Chromium and Firefox), and switches the page of the Firefox window.

1 Like

BTW The sleep is not necessary in my code.

1 Like

Great Job: Thanks, It worked… Many Thanks.

1 Like