cancel
Showing results for 
Search instead for 
Did you mean: 

Utilising If.. Then to check if browser running

Highlighted
Occasional Contributor

Utilising If.. Then to check if browser running

Version: 12.50.4142.7 x64

 

I am noticing very intermittent behaviour for tests in my Project Suite which utilise running a browser (Internet Explorer).

 

I have common failures that the "Run Browser" command simply doesn't work so this then breaks the test. I have previously tried to do this alternatvley utilising Start > Run option and I have seen references to code but I just want to use the available option to run a browser and for it to be consistent.

 

I did think I can use an If ... Then condition using Sys.WaitBrowser().Exists Equals False that if the Run Browser doesn't work this is can be triggered but this doesn't seem to work.

 

Any advice would be appreciated.

3 REPLIES 3
Community Hero

Re: Utilising If.. Then to check if browser running

Hi,

 

In general your approach is correct. You are correctly using .WaitBrowser() to check if the given browser process is running.

The case is that quite often I've seen that IE does not always closes its process and this causes TestComplete to stuck until IE process is closed. So in case of IE you may choose not to check whether IE is running or not, but terminate all running instances of IE and start it anew.

Relevant discussion along with the code can be found here: https://community.smartbear.com/t5/TestComplete-Functional-Web/Leave-site-pop-up-is-getting-displaye...

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Occasional Contributor

Re: Utilising If.. Then to check if browser running

So instead of using the GUI it's best to write underlying code to achieve proper closure of browser instances? The behaviour is very intermittent when using the GUI functions. Sometimes it will open a browser window, sometimes it won't.

Community Hero

Re: Utilising If.. Then to check if browser running

Hi,

 

> So instead of using the GUI it's best to write underlying code to achieve proper closure of browser instances?

You may try to close browser using GUI, wait for some time (depending on your tested application) for the browser process to not exists and terminate the process if it did not end within the timeout (with or without warning posted to test log, which is up to you).

It is my understanding that the behaviour depends on the tested application, as I had a web application that quite often caused IE process to stay in memory while everything was fine with other browsers (FF, Chrome, Edge).

 

P.S. And check that you have set up IE according to the recommendations from TC help (especially - to disable it running in the background).

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
New Here?
Join us and watch the welcome video:
SeptemberNews
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win