How to use already opened browser for script execution

Hi team,

I want to use same session (chrome browser) for my scripts execution instead of launching new session for each script. Could you please let me know the possibilities and any code if u have?

Hope these help!

Just an FYI, this is generally discouraged from a test methodology perspective. Reusing an existing browser instance adds extra unknowns to your tests, including browser cache data, cookies, etc. You can reuse an existing browser instance for debugging your scripts by clicking on a line in your script and choosing “Run from here”. But again, I would not do this for actual test executions.

1 Like

As noted, you can keep the initial browser session open and then attach to that. For example, I can run the Login script then keep using that browser session. If you click the Down Arrow next to the Run button there will be a submenu for your browser, that is the open session.

You can also set a breakpoint for your script, then launch it using the Debug button. You will then be able to step through the code or run a different script for the same browser.

The option to continue running a sequential test case using the currently open browser has been removed. Will this option be available again? I break down my test cases in small iterations and like to run them individually prior to moving them to a Test Suite. Without this option, I am having to create 1 huge test case.