Ask a Question

Utilising If.. Then to check if browser running

rzirpolo
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
AlexKaras
Champion Level 3

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 Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
rzirpolo
Occasional Contributor

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.

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 Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
cancel
Showing results for 
Search instead for 
Did you mean: