cancel
Showing results for 
Search instead for 
Did you mean: 

How can I open new browser session by test complete

Occasional Contributor

How can I open new browser session by test complete

I need to work on multiple urls in my project with different browser instances. When I use Browsers.Item(btIExplorer).Run(url1)It is entering url with existing browser.

When I try WshShell.Run("iexplore.exe " +url2), IE is getting hang every now and then. It is not working always

When I try  Sys.Browser('iexplore').BrowserWindow(0).Keys("^t"), it is opening new tab, but still url is entering in the previous tab. 

Question 1: Is there any direct method in Testcomplete to launch new browser instance (in IE & Chrome)

Question 2: If no, how can I identify the last opened browser and enter my application URL to that browser.

5 REPLIES 5
Community Hero

Re: How can I open new browser session by test complete


@fayizkc wrote:

Question 1: Is there any direct method in Testcomplete to launch new browser instance (in IE & Chrome)

AFAIK, There is no direct way to ignore the current instance of chrome/ie and open a new browser instance. 

 


@fayizkc wrote:

Question 2: If no, how can I identify the last opened browser and enter my application URL to that browser.


Check using Sys.Process("browser").Exists. If exists then use that browser instance to do so.

 

 


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Occasional Contributor

Re: How can I open new browser session by test complete

Shankar,

As I want to work with multiple URLs at same time, Sys.Process("browser").Exists will be true if I need to open new browser instance. My requirement is, need to open a new url as a separate instance to validate something in between the execution of my primary url without closing it. What solution we have in Test complete

Community Hero

Re: How can I open new browser session by test complete

If you want to launch a new browser instance then you can use WshShell like below

WshShell.Run("powershell -command start chrome ");

to activate the chrome, loop thru the browser instances.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”


Extension Available

Occasional Contributor

Re: How can I open new browser session by test complete

I already used WshShell.Run("iexplore.exe " +url2) as I mentioned in the question. But browser is getting hang every now and then when I use that method

Occasional Contributor

Re: How can I open new browser session by test complete

As you mentioned  - When I try  Sys.Browser('iexplore').BrowserWindow(0).Keys("^t"), it is opening new tab, but still url is entering in the previous tab. - Focus will be on to the previous tab. When a new tab is created using Keys Method, You have to click on the Edit Bar of the browser for the new tab and then enter the URL.

 

Later you can use Keys method to navigate between tabs.

New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video
Top Kudoed Authors