cancel
Showing results for 
Search instead for 
Did you mean: 

Browser Loop Close and Reopen Browser

Highlighted
Frequent Contributor

Browser Loop Close and Reopen Browser

Hello,

 

is it possible to close and reopen the browser during a Browser Loop Teststep?

 

I know that I can close the browser with browser - close Operation ... but I can't figure out how to reopen the same browser, that is used in the running browser loop operation.

 

As I need a new session, ctrl F5 doesn't work in this case.

 

Would be thankful for any help

4 REPLIES 4
Highlighted
Community Hero

Re: Browser Loop Close and Reopen Browser

Hi,

 

You can use another loop (FOR, WHILE) instead of Browser Loop:

 

WHILE something
    open browser
    do something
    close browser
    open browser
    do something
    ...
Highlighted
Community Hero

Re: Browser Loop Close and Reopen Browser

Hi,

 

I think that you will need a piece of coding here.

Browser Loop gets a list of installed browsers, iterates through it then and launches the next browser from the list. The launched browser is identified by its name and bitness (and also version, but this is irrelevant because it is not too common to have, say, two different versions of Chrome an the same box at the same time).

So, when you need to restart the browser, you need to get its name and bitness using properties of the CurrentBrowser object (this is where the coding will be needed), close the browser, wait until its process gone, start new instance of the browser using name and bitness obtained previously and continue.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
New Contributor

Re: Browser Loop Close and Reopen Browser

Do you have an example of how to get the name and bitness from a script?

Highlighted
Community Hero

Re: Browser Loop Close and Reopen Browser

Hi,

 

> how to get the name and bitness

The name and bitness of what?

Have you examined properties of the process/object of interest in the Object Browser?

Have you read the documentation for Process, Browser, BrowserInfo or other object that you are interested in?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
A new challenge is here!

Create a function to drag one element to another for the TechCorner tag!

Will you dare to take the challenge?


Scripts created in July:
- Passing custom command-line arguments as a test parameter
Top Kudoed Authors