SmartNav.js vs. InternetExplorer doc. from shdocvw and mshtml

Discussion in 'ASP .Net' started by Lars-Erik Aabech, Oct 24, 2005.

  1. Hi!

    I've been walking in extacy since reading the article about test automation
    with IE in the latest MSDN mag.
    (http://msdn.microsoft.com/msdnmag/issues/05/10/TestRun/default.aspx)

    After a while, I had to find an issue I couldn't solve. (Of course)

    If an ASP.NET page uses the smartnav option, the document you get from IE
    only contains the viewstate input etc, the scripts and an IFrame.
    For some reason I cannot access the frames, location and others properties
    of the document, so I cannot get frames[1] (i.e.). I can traverse children,
    see design properties, innerHTML and most others though.

    Here's some code describing the problem better:

    InternetExplorer ie = null;
    Process p = Process.Start("iexplore.exe", "about:blank");
    InternetExplorer ie = // code to find correct IE

    // code to navigate IE to page with smartnav
    // ...

    HTMLDocument doc = (HTMLDocument)ie.Document;
    HTMLInputElement textbox =
    (HTMLInputElement)doc.getElementById("someIdIKnowExist");

    // the textbox variable is null if smartnav is on


    So the questions Are:
    1. Have anyone tried this and found a solution?
    2. If not, anyone had trouble with specific properties of a document?
    3. Any other bright ideas? :p

    Hope you can help! This method is awesome! Go read that article on top if
    you didn't.. Kudos to the author.

    L-E
    Lars-Erik Aabech, Oct 24, 2005
    #1
    1. Advertising

  2. Hi L-E,

    Welcome to ASPNET group.
    Regarding on the problem you mentioned, I've performed some testing on my
    local side, but didn't encounter the same problem you mentioned. I think
    it is likely a environment specific issue. For SmartNavigation, there does
    exists some issues in the earlier version of asp.net's SmarNav.js file.
    The problem used to occur when the serverside asp.net turn on
    smartNavigation and use response.Redirect to redirect to other pages, is
    this also the case in your problem? Also, if you manually use IE browser
    (interactively) to navigate to the error page and perform the same
    operation ,will you get a blank page also? Generally using the internet
    control component to programmatically automate the IE should have the same
    behavior as our interactive operations.

    Please feel free to post here if you have any other findings.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)



    --------------------
    | Reply-To: "Lars-Erik Aabech" <>
    | From: "Lars-Erik Aabech" <>
    | Subject: SmartNav.js vs. InternetExplorer doc. from shdocvw and mshtml
    | Date: Tue, 25 Oct 2005 00:09:30 +0200
    | Lines: 41
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | X-RFC2646: Format=Flowed; Original
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | Message-ID: <#>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: host-81-191-131-56.bluecom.no 81.191.131.56
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:133580
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Hi!
    |
    | I've been walking in extacy since reading the article about test
    automation
    | with IE in the latest MSDN mag.
    | (http://msdn.microsoft.com/msdnmag/issues/05/10/TestRun/default.aspx)
    |
    | After a while, I had to find an issue I couldn't solve. (Of course)
    |
    | If an ASP.NET page uses the smartnav option, the document you get from IE
    | only contains the viewstate input etc, the scripts and an IFrame.
    | For some reason I cannot access the frames, location and others
    properties
    | of the document, so I cannot get frames[1] (i.e.). I can traverse
    children,
    | see design properties, innerHTML and most others though.
    |
    | Here's some code describing the problem better:
    |
    | InternetExplorer ie = null;
    | Process p = Process.Start("iexplore.exe", "about:blank");
    | InternetExplorer ie = // code to find correct IE
    |
    | // code to navigate IE to page with smartnav
    | // ...
    |
    | HTMLDocument doc = (HTMLDocument)ie.Document;
    | HTMLInputElement textbox =
    | (HTMLInputElement)doc.getElementById("someIdIKnowExist");
    |
    | // the textbox variable is null if smartnav is on
    |
    |
    | So the questions Are:
    | 1. Have anyone tried this and found a solution?
    | 2. If not, anyone had trouble with specific properties of a document?
    | 3. Any other bright ideas? :p
    |
    | Hope you can help! This method is awesome! Go read that article on top if
    | you didn't.. Kudos to the author.
    |
    | L-E
    |
    |
    |
    Steven Cheng[MSFT], Oct 25, 2005
    #2
    1. Advertising

  3. Hi again!

    Thanks for a fast reply! :)
    I'm on another computer today, and it seems it works on this one. I had to
    do a minor tweak though, not sure if it will work on the other computer, but
    I'll update the thread when i've checked. In the test code I use the
    AutoResetEvent class with IE's DocumentComplete event. When navigating to
    the page in question it seems like IE does two requests. I added a second
    autoResetEvent.WaitOne() call to the code, and voilĂ .
    I also created a small test project to prove that smartnav was the bad guy,
    but it worked so I was a bit stumped. I'll try the same test project at the
    other computer for more information. :)

    Anyway, the other problem I had was that the HTMLDocument returned from the
    InternetExplorer object has trouble with some properties. When examining the
    instance in debug mode, the properties "frames", "location", "parentWindow",
    "Script" and a number of IHTMLDocument2_xx evaluates to an
    InvalidCastException. Those are really useful, although I can do without..
    :)
    Any ideas?

    L-E



    "Steven Cheng[MSFT]" <> wrote in message
    news:...
    > Hi L-E,
    >
    > Welcome to ASPNET group.
    > Regarding on the problem you mentioned, I've performed some testing on my
    > local side, but didn't encounter the same problem you mentioned. I think
    > it is likely a environment specific issue. For SmartNavigation, there does
    > exists some issues in the earlier version of asp.net's SmarNav.js file.
    > The problem used to occur when the serverside asp.net turn on
    > smartNavigation and use response.Redirect to redirect to other pages, is
    > this also the case in your problem? Also, if you manually use IE browser
    > (interactively) to navigate to the error page and perform the same
    > operation ,will you get a blank page also? Generally using the internet
    > control component to programmatically automate the IE should have the same
    > behavior as our interactive operations.
    >
    > Please feel free to post here if you have any other findings.
    >
    > Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    >
    > --------------------
    > | Reply-To: "Lars-Erik Aabech" <>
    > | From: "Lars-Erik Aabech" <>
    > | Subject: SmartNav.js vs. InternetExplorer doc. from shdocvw and mshtml
    > | Date: Tue, 25 Oct 2005 00:09:30 +0200
    > | Lines: 41
    > | X-Priority: 3
    > | X-MSMail-Priority: Normal
    > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    > | X-RFC2646: Format=Flowed; Original
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    > | Message-ID: <#>
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    > | NNTP-Posting-Host: host-81-191-131-56.bluecom.no 81.191.131.56
    > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    > | Xref: TK2MSFTNGXA01.phx.gbl
    > microsoft.public.dotnet.framework.aspnet:133580
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > |
    > | Hi!
    > |
    > | I've been walking in extacy since reading the article about test
    > automation
    > | with IE in the latest MSDN mag.
    > | (http://msdn.microsoft.com/msdnmag/issues/05/10/TestRun/default.aspx)
    > |
    > | After a while, I had to find an issue I couldn't solve. (Of course)
    > |
    > | If an ASP.NET page uses the smartnav option, the document you get from
    > IE
    > | only contains the viewstate input etc, the scripts and an IFrame.
    > | For some reason I cannot access the frames, location and others
    > properties
    > | of the document, so I cannot get frames[1] (i.e.). I can traverse
    > children,
    > | see design properties, innerHTML and most others though.
    > |
    > | Here's some code describing the problem better:
    > |
    > | InternetExplorer ie = null;
    > | Process p = Process.Start("iexplore.exe", "about:blank");
    > | InternetExplorer ie = // code to find correct IE
    > |
    > | // code to navigate IE to page with smartnav
    > | // ...
    > |
    > | HTMLDocument doc = (HTMLDocument)ie.Document;
    > | HTMLInputElement textbox =
    > | (HTMLInputElement)doc.getElementById("someIdIKnowExist");
    > |
    > | // the textbox variable is null if smartnav is on
    > |
    > |
    > | So the questions Are:
    > | 1. Have anyone tried this and found a solution?
    > | 2. If not, anyone had trouble with specific properties of a document?
    > | 3. Any other bright ideas? :p
    > |
    > | Hope you can help! This method is awesome! Go read that article on top
    > if
    > | you didn't.. Kudos to the author.
    > |
    > | L-E
    > |
    > |
    > |
    >
    Lars-Erik Aabech, Oct 25, 2005
    #3
  4. Thanks for your response L-E,

    For the IHtmlDocument, the different version may have its limited
    implementation and some property may not works as expected ( which we used
    in page's clientside scripting....).
    Anyway, here is some of my local test results:

    for the frames, we should first reference the parentWindow of the
    HtmlDocument object , then access the iframe collection through the
    parentWindow.frames , e.g:

    =============================
    mshtml.HTMLWindow2Class parentW =
    (mshtml.HTMLWindow2Class)theDoc.parentWindow;
    Console.WriteLine("there are {0} frames in this
    window........",parentW.frames.length);

    for(int j=0;j<parentW.frames.length;j++)
    {
    //mshtml.IHTMLFramesCollection2 frames = parentW.frames
    object index = j;
    mshtml.HTMLWindow2Class hw = (HTMLWindow2Class)parentW.frames.item(ref
    index);

    Console.WriteLine("frame " +j + " " + hw.name);
    }
    ============================

    for the location, we can also use the mshtml.HTMLLocation to reference the
    Document.parentWindow.location and query its fields:
    ============================
    mshtml.HTMLLocation location = theDoc.parentWindow.location;
    Console.WriteLine("location.hostname:{0}, location.protocol:{1},
    location.port:{2},
    location.href:{3}",location.hostname,location.protocol,location.port,locatio
    n.href);

    ============================

    for unknown objects, we can first query its type through object.GetType()
    and modify the code to cast them.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)


    --------------------
    | From: "Lars-Erik Aabech" <>
    | References: <#>
    <>
    | Subject: Re: SmartNav.js vs. InternetExplorer doc. from shdocvw and mshtml
    | Date: Tue, 25 Oct 2005 08:09:12 +0200
    | Lines: 124
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | X-RFC2646: Format=Flowed; Original
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | Message-ID: <OF$>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: 213.160.225.168
    | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:133640
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | Hi again!
    |
    | Thanks for a fast reply! :)
    | I'm on another computer today, and it seems it works on this one. I had
    to
    | do a minor tweak though, not sure if it will work on the other computer,
    but
    | I'll update the thread when i've checked. In the test code I use the
    | AutoResetEvent class with IE's DocumentComplete event. When navigating to
    | the page in question it seems like IE does two requests. I added a second
    | autoResetEvent.WaitOne() call to the code, and voil?
    | I also created a small test project to prove that smartnav was the bad
    guy,
    | but it worked so I was a bit stumped. I'll try the same test project at
    the
    | other computer for more information. :)
    |
    | Anyway, the other problem I had was that the HTMLDocument returned from
    the
    | InternetExplorer object has trouble with some properties. When examining
    the
    | instance in debug mode, the properties "frames", "location",
    "parentWindow",
    | "Script" and a number of IHTMLDocument2_xx evaluates to an
    | InvalidCastException. Those are really useful, although I can do
    without..
    | :)
    | Any ideas?
    |
    | L-E
    |
    |
    |
    | "Steven Cheng[MSFT]" <> wrote in message
    | news:...
    | > Hi L-E,
    | >
    | > Welcome to ASPNET group.
    | > Regarding on the problem you mentioned, I've performed some testing on
    my
    | > local side, but didn't encounter the same problem you mentioned. I
    think
    | > it is likely a environment specific issue. For SmartNavigation, there
    does
    | > exists some issues in the earlier version of asp.net's SmarNav.js
    file.
    | > The problem used to occur when the serverside asp.net turn on
    | > smartNavigation and use response.Redirect to redirect to other pages, is
    | > this also the case in your problem? Also, if you manually use IE
    browser
    | > (interactively) to navigate to the error page and perform the same
    | > operation ,will you get a blank page also? Generally using the
    internet
    | > control component to programmatically automate the IE should have the
    same
    | > behavior as our interactive operations.
    | >
    | > Please feel free to post here if you have any other findings.
    | >
    | > Thanks,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | >
    | >
    | > --------------------
    | > | Reply-To: "Lars-Erik Aabech" <>
    | > | From: "Lars-Erik Aabech" <>
    | > | Subject: SmartNav.js vs. InternetExplorer doc. from shdocvw and mshtml
    | > | Date: Tue, 25 Oct 2005 00:09:30 +0200
    | > | Lines: 41
    | > | X-Priority: 3
    | > | X-MSMail-Priority: Normal
    | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | > | X-RFC2646: Format=Flowed; Original
    | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | > | Message-ID: <#>
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | > | NNTP-Posting-Host: host-81-191-131-56.bluecom.no 81.191.131.56
    | > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    | > | Xref: TK2MSFTNGXA01.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet:133580
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | > |
    | > | Hi!
    | > |
    | > | I've been walking in extacy since reading the article about test
    | > automation
    | > | with IE in the latest MSDN mag.
    | > | (http://msdn.microsoft.com/msdnmag/issues/05/10/TestRun/default.aspx)
    | > |
    | > | After a while, I had to find an issue I couldn't solve. (Of course)
    | > |
    | > | If an ASP.NET page uses the smartnav option, the document you get
    from
    | > IE
    | > | only contains the viewstate input etc, the scripts and an IFrame.
    | > | For some reason I cannot access the frames, location and others
    | > properties
    | > | of the document, so I cannot get frames[1] (i.e.). I can traverse
    | > children,
    | > | see design properties, innerHTML and most others though.
    | > |
    | > | Here's some code describing the problem better:
    | > |
    | > | InternetExplorer ie = null;
    | > | Process p = Process.Start("iexplore.exe", "about:blank");
    | > | InternetExplorer ie = // code to find correct IE
    | > |
    | > | // code to navigate IE to page with smartnav
    | > | // ...
    | > |
    | > | HTMLDocument doc = (HTMLDocument)ie.Document;
    | > | HTMLInputElement textbox =
    | > | (HTMLInputElement)doc.getElementById("someIdIKnowExist");
    | > |
    | > | // the textbox variable is null if smartnav is on
    | > |
    | > |
    | > | So the questions Are:
    | > | 1. Have anyone tried this and found a solution?
    | > | 2. If not, anyone had trouble with specific properties of a document?
    | > | 3. Any other bright ideas? :p
    | > |
    | > | Hope you can help! This method is awesome! Go read that article on
    top
    | > if
    | > | you didn't.. Kudos to the author.
    | > |
    | > | L-E
    | > |
    | > |
    | > |
    | >
    |
    |
    |
    Steven Cheng[MSFT], Oct 26, 2005
    #4
  5. Hi L-E,

    Have you got any further progress on this or does the things in my last
    reply helps a little? If there're anything else we can help, please feel
    free to post here. Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    --------------------
    | X-Tomcat-ID: 235034257
    | References: <#>
    <>
    <OF$>
    | MIME-Version: 1.0
    | Content-Type: text/plain
    | Content-Transfer-Encoding: 7bit
    | From: (Steven Cheng[MSFT])
    | Organization: Microsoft
    | Date: Wed, 26 Oct 2005 11:53:34 GMT
    | Subject: Re: SmartNav.js vs. InternetExplorer doc. from shdocvw and mshtml
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | Message-ID: <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | Lines: 190
    | Path: TK2MSFTNGXA01.phx.gbl
    | Xref: TK2MSFTNGXA01.phx.gbl
    microsoft.public.dotnet.framework.aspnet:133896
    | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
    |
    | Thanks for your response L-E,
    |
    | For the IHtmlDocument, the different version may have its limited
    | implementation and some property may not works as expected ( which we
    used
    | in page's clientside scripting....).
    | Anyway, here is some of my local test results:
    |
    | for the frames, we should first reference the parentWindow of the
    | HtmlDocument object , then access the iframe collection through the
    | parentWindow.frames , e.g:
    |
    | =============================
    | mshtml.HTMLWindow2Class parentW =
    | (mshtml.HTMLWindow2Class)theDoc.parentWindow;
    | Console.WriteLine("there are {0} frames in this
    | window........",parentW.frames.length);
    |
    | for(int j=0;j<parentW.frames.length;j++)
    | {
    | //mshtml.IHTMLFramesCollection2 frames = parentW.frames
    | object index = j;
    | mshtml.HTMLWindow2Class hw = (HTMLWindow2Class)parentW.frames.item(ref
    | index);
    |
    | Console.WriteLine("frame " +j + " " + hw.name);
    | }
    | ============================
    |
    | for the location, we can also use the mshtml.HTMLLocation to reference
    the
    | Document.parentWindow.location and query its fields:
    | ============================
    | mshtml.HTMLLocation location = theDoc.parentWindow.location;
    | Console.WriteLine("location.hostname:{0}, location.protocol:{1},
    | location.port:{2},
    |
    location.href:{3}",location.hostname,location.protocol,location.port,locatio
    | n.href);
    |
    | ============================
    |
    | for unknown objects, we can first query its type through object.GetType()
    | and modify the code to cast them.
    |
    | Thanks,
    |
    | Steven Cheng
    | Microsoft Online Support
    |
    | Get Secure! www.microsoft.com/security
    | (This posting is provided "AS IS", with no warranties, and confers no
    | rights.)
    |
    |
    | --------------------
    | | From: "Lars-Erik Aabech" <>
    | | References: <#>
    | <>
    | | Subject: Re: SmartNav.js vs. InternetExplorer doc. from shdocvw and
    mshtml
    | | Date: Tue, 25 Oct 2005 08:09:12 +0200
    | | Lines: 124
    | | X-Priority: 3
    | | X-MSMail-Priority: Normal
    | | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | | X-RFC2646: Format=Flowed; Original
    | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | | Message-ID: <OF$>
    | | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | | NNTP-Posting-Host: 213.160.225.168
    | | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    | | Xref: TK2MSFTNGXA01.phx.gbl
    | microsoft.public.dotnet.framework.aspnet:133640
    | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | |
    | | Hi again!
    | |
    | | Thanks for a fast reply! :)
    | | I'm on another computer today, and it seems it works on this one. I had
    | to
    | | do a minor tweak though, not sure if it will work on the other
    computer,
    | but
    | | I'll update the thread when i've checked. In the test code I use the
    | | AutoResetEvent class with IE's DocumentComplete event. When navigating
    to
    | | the page in question it seems like IE does two requests. I added a
    second
    | | autoResetEvent.WaitOne() call to the code, and voil?
    | | I also created a small test project to prove that smartnav was the bad
    | guy,
    | | but it worked so I was a bit stumped. I'll try the same test project at
    | the
    | | other computer for more information. :)
    | |
    | | Anyway, the other problem I had was that the HTMLDocument returned from
    | the
    | | InternetExplorer object has trouble with some properties. When
    examining
    | the
    | | instance in debug mode, the properties "frames", "location",
    | "parentWindow",
    | | "Script" and a number of IHTMLDocument2_xx evaluates to an
    | | InvalidCastException. Those are really useful, although I can do
    | without..
    | | :)
    | | Any ideas?
    | |
    | | L-E
    | |
    | |
    | |
    | | "Steven Cheng[MSFT]" <> wrote in message
    | | news:...
    | | > Hi L-E,
    | | >
    | | > Welcome to ASPNET group.
    | | > Regarding on the problem you mentioned, I've performed some testing
    on
    | my
    | | > local side, but didn't encounter the same problem you mentioned. I
    | think
    | | > it is likely a environment specific issue. For SmartNavigation, there
    | does
    | | > exists some issues in the earlier version of asp.net's SmarNav.js
    | file.
    | | > The problem used to occur when the serverside asp.net turn on
    | | > smartNavigation and use response.Redirect to redirect to other pages,
    is
    | | > this also the case in your problem? Also, if you manually use IE
    | browser
    | | > (interactively) to navigate to the error page and perform the same
    | | > operation ,will you get a blank page also? Generally using the
    | internet
    | | > control component to programmatically automate the IE should have the
    | same
    | | > behavior as our interactive operations.
    | | >
    | | > Please feel free to post here if you have any other findings.
    | | >
    | | > Thanks,
    | | >
    | | > Steven Cheng
    | | > Microsoft Online Support
    | | >
    | | > Get Secure! www.microsoft.com/security
    | | > (This posting is provided "AS IS", with no warranties, and confers no
    | | > rights.)
    | | >
    | | >
    | | >
    | | > --------------------
    | | > | Reply-To: "Lars-Erik Aabech" <>
    | | > | From: "Lars-Erik Aabech" <>
    | | > | Subject: SmartNav.js vs. InternetExplorer doc. from shdocvw and
    mshtml
    | | > | Date: Tue, 25 Oct 2005 00:09:30 +0200
    | | > | Lines: 41
    | | > | X-Priority: 3
    | | > | X-MSMail-Priority: Normal
    | | > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | | > | X-RFC2646: Format=Flowed; Original
    | | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | | > | Message-ID: <#>
    | | > | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | | > | NNTP-Posting-Host: host-81-191-131-56.bluecom.no 81.191.131.56
    | | > | Path:
    TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    | | > | Xref: TK2MSFTNGXA01.phx.gbl
    | | > microsoft.public.dotnet.framework.aspnet:133580
    | | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    | | > |
    | | > | Hi!
    | | > |
    | | > | I've been walking in extacy since reading the article about test
    | | > automation
    | | > | with IE in the latest MSDN mag.
    | | > |
    (http://msdn.microsoft.com/msdnmag/issues/05/10/TestRun/default.aspx)
    | | > |
    | | > | After a while, I had to find an issue I couldn't solve. (Of course)
    | | > |
    | | > | If an ASP.NET page uses the smartnav option, the document you get
    | from
    | | > IE
    | | > | only contains the viewstate input etc, the scripts and an IFrame.
    | | > | For some reason I cannot access the frames, location and others
    | | > properties
    | | > | of the document, so I cannot get frames[1] (i.e.). I can traverse
    | | > children,
    | | > | see design properties, innerHTML and most others though.
    | | > |
    | | > | Here's some code describing the problem better:
    | | > |
    | | > | InternetExplorer ie = null;
    | | > | Process p = Process.Start("iexplore.exe", "about:blank");
    | | > | InternetExplorer ie = // code to find correct IE
    | | > |
    | | > | // code to navigate IE to page with smartnav
    | | > | // ...
    | | > |
    | | > | HTMLDocument doc = (HTMLDocument)ie.Document;
    | | > | HTMLInputElement textbox =
    | | > | (HTMLInputElement)doc.getElementById("someIdIKnowExist");
    | | > |
    | | > | // the textbox variable is null if smartnav is on
    | | > |
    | | > |
    | | > | So the questions Are:
    | | > | 1. Have anyone tried this and found a solution?
    | | > | 2. If not, anyone had trouble with specific properties of a
    document?
    | | > | 3. Any other bright ideas? :p
    | | > |
    | | > | Hope you can help! This method is awesome! Go read that article on
    | top
    | | > if
    | | > | you didn't.. Kudos to the author.
    | | > |
    | | > | L-E
    | | > |
    | | > |
    | | > |
    | | >
    | |
    | |
    | |
    |
    |
    Steven Cheng[MSFT], Nov 3, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ryan Clark

    shdocvw.internetexplorer object help

    Ryan Clark, Jan 6, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    6,501
    quantum
    Feb 2, 2004
  2. quantum

    Using SHDocVW-InternetExplorer

    quantum, Feb 2, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    2,362
    quantum
    Feb 2, 2004
  3. =?Utf-8?B?am9zZQ==?=

    shdocvw

    =?Utf-8?B?am9zZQ==?=, Jun 3, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    537
    Scott Allen
    Jun 4, 2005
  4. Richard Bell
    Replies:
    19
    Views:
    5,437
    Carlos Oliva
    Feb 20, 2004
  5. Matt
    Replies:
    3
    Views:
    479
    Tor Iver Wilhelmsen
    Sep 17, 2004
Loading...

Share This Page