TestcComplete does not find chrome browser with "Sys.WaitBrowser"
Hi,
I have a script that validate if the browser Exists and if true it calls the Navigate method and if not it call the Run method.
My problem is :
Even though the browser is already running, it always thinks that it's not. So the script calls the Run method. The funny thing is that afterward, the log has en entry saying "the browser is already running". I know !!!
I've put a delay of 10 seconds and it doesn't change anything.
This is the method :
def ClickBoutonOkFiltres():
url = Project.Variables.navigate_url
# Launch Chrome if it is not running
if (Sys.WaitBrowser(btChrome, 10000).Exists):
Browsers.Item[btChrome].Navigate(url)
else:
Browsers.Item[btChrome].Run(url)
This is the message in the log afterward :
Thanks !
Hello klabbe ,
Sys.WaitBrowser Method requires only browser process name "chrome" not the browser constant btChrome. So, you can change the below code as,
def ClickBoutonOkFiltres():
url = Project.Variables.navigate_url
# Launch Chrome if it is not running
if (Sys.WaitBrowser("chrome", 10000).Exists):
Browsers.Item[btChrome].Navigate(url)else:
Browsers.Item[btChrome].Run(url)