Forum Discussion

Veroniquelu's avatar
Veroniquelu
Contributor
9 years ago

Lauching IE not successfully

This might be an old topic, I am using below script to launch IE, but I found sometimes, it can not be done successfully, because the browser is already running while clearly the browser is not launched... Is there any way that I can improve this? I tried other methods before I came up with below script, this is the best solution so far, if I go with other solutions, I am more likely to fail lauching the browser. Even with this one, it fails sometimes with much lower frequency

 

while (Sys.WaitBrowser().Exists)
Sys.WaitBrowser().Close();
Browsers.Item(btIExplorer).Run();
webPageObj = Sys.Browser("iexplore*").Page("*");
Sys.Browser().BrowserWindow(0).Maximize();
Browsers.CurrentBrowser.Navigate(ProjectSuite.Variables.url)
webPageObj.Wait(10);

4 Replies

  • Check for iexplore.exe as a process and kill any/all instances of that before you start.

     

    More guaranteed to clear it up killing the process than the application ....

    • Veroniquelu's avatar
      Veroniquelu
      Contributor

      Ok, Thanks for the suggestion, it's working well so far :P

      • Rocky001's avatar
        Rocky001
        New Contributor
        Code for closing borwsers through TaskManager: Public Function CloseAllBrowser() On Error Resume Next Log.Message ("CloseAllBrowser Function Started") IExplore = Sys.FindAllChildren("ProcessName","iexplore",2) ' IExplore = Sys.FindAllChildren("ProcessName","iexplore") If UBound(IExplore)>=0 Then For i = UBound(IExplore) to LBound(IExplore) Step -1 IExplore(i).Terminate Next End If '******** ErrorHandling ********* If Err.Number <> 0 Then Call ErrMyErrorHandler End If '*************** Log.Message ("CloseAllBrowser Function Completed") End Function