Forum Discussion

Southpaw's avatar
Southpaw
Contributor
6 years ago
Solved

Help launching IE usnig VB in script editor

Hello - Im trying to launch IE using the below snippet. It doesnt launch IE. It doenst fail either. Ive tried it without the params around the url too. Nothing. Am I missing something?

 

Sub LaunchIE
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = 0
IE.navigate ("https://google.com")
End Sub

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Why are you trying to launch it using CreateObject?

    TestComplete has a "Browsers" object that allows you to launch any browser insalled on your machine.

     

    https://support.smartbear.com/testcomplete/docs/app-testing/web/general/common-tasks/launching-browsers.html#Scripts

     

    In VBScript, you would do this:

     

    Browsers.Item("iexplore").Run

    You would then access the IE browser by something like "Sys.Browser('iexplore')" or (recommended) with the mapped Alias of "Aliases.<browser node name>" and call the navigate methods from there.

    • Southpaw's avatar
      Southpaw
      Contributor

      Nice - coming from UFT world and its object repository was not reliable so ive always used 'descriptive programming' bypassing the object rep. Thanks much for the quick reply.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        TestComplete's NameMapping technology is VERY reliable.   While descriptive programming may have been the norm for UFT, NameMapping is the norm for TestComplete.