Results 1 to 4 of 4

Thread: Working with IE Object

  1. #1
    Expert Member
    Join Date
    Oct 2007
    Answers
    375

    Working with IE Object

    Hi Geeks,

    I am working with IE Object Model. I wish to trap the Caption / title of the Newly opened window. I am using the below code in a .vbs file.I am not able to find a property or method that pertains to Window Caption or working with Window Objects.

    The code is somewhat like -

    dim objIE
    set objIE = CreateObject("InternetExplorer.Application")
    objIE.visible = true
    objIE.StatusBar = 1

    objIE.Navigate "http://www.google.com"

    while objIE.ReadyState = true
    msgbox objIE.getProperty(Caption)
    wend

    The code returns an empty message box. I want to capture the Window title or Caption. Any Ideas anybody..... Thanks in Advance.

    Cheers....


  2. #2

    Re: Working with IE Object

    bizzzare, try this:

    Public Function appBrowser()
    set descBrowser = description.create()
    descBrowser("micclass").value="Browser"
    If Desktop.ChildObjects(descBrowser).count>1 Then
    descBrowser("Creationtime").value = 0
    End If
    Set appBrowser = descBrowser
    Set descBrowser = nothing
    End Function

    brProperty=Browser(appbrowser).GetROProperty ("title")
    Print brProperty

    Last edited by Anshoo_Arora; 01-08-2008 at 04:26 PM.

  3. #3
    Expert Member
    Join Date
    Oct 2007
    Answers
    375

    Re: Working with IE Object

    Hi Anshoo,

    Thanks for the answer mate...

    But unfortunately I am trying to work with the .vbs part only. This is as part of a Modular framework I am trying to develop for Automated applications.

    So I like wanted a method / property pertaining to IE Object only. It cannot be QTP Specific.

    Anyways, thanks again for the reply..

    Cheers...


  4. #4

    Re: Working with IE Object

    Dim objIE
    Set objIE = GetObject("InternetExplorer.Application")
    Msgbox objIE.Parent

    Strangely, this works. It displays the name of the Browser, but not the title. Title, caption, status etc. don't seem to work. I am going to try some more tomorrow morning.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact