Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > SmartNav.js vs. InternetExplorer doc. from shdocvw and mshtml

Reply
Thread Tools

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

 
 
Lars-Erik Aabech
Guest
Posts: n/a
 
      10-24-2005
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/is...n/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("someIdIKnowE xist");

// 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?

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

L-E


 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      10-25-2005
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" <(E-Mail Removed)>
| From: "Lars-Erik Aabech" <(E-Mail Removed)>
| 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: <#(E-Mail Removed)>
| 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!tk2msft ngp13.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/is...n/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("someIdIKnowE xist");
|
| // 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?
|
| Hope you can help! This method is awesome! Go read that article on top if
| you didn't.. Kudos to the author.
|
| L-E
|
|
|

 
Reply With Quote
 
 
 
 
Lars-Erik Aabech
Guest
Posts: n/a
 
      10-25-2005
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]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)>
> | From: "Lars-Erik Aabech" <(E-Mail Removed)>
> | 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: <#(E-Mail Removed)>
> | 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!tk2msft ngp13.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/is...n/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("someIdIKnowE xist");
> |
> | // 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?
> |
> | Hope you can help! This method is awesome! Go read that article on top
> if
> | you didn't.. Kudos to the author.
> |
> | L-E
> |
> |
> |
>



 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      10-26-2005
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.prot ocol,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" <(E-Mail Removed)>
| References: <#(E-Mail Removed)>
<(E-Mail Removed)>
| 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$(E-Mail Removed)>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 213.160.225.168
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.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]" <(E-Mail Removed)> wrote in message
| news:(E-Mail Removed)...
| > 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" <(E-Mail Removed)>
| > | From: "Lars-Erik Aabech" <(E-Mail Removed)>
| > | 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: <#(E-Mail Removed)>
| > | 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!tk2msft ngp13.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/is...n/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("someIdIKnowE xist");
| > |
| > | // 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?
| > |
| > | Hope you can help! This method is awesome! Go read that article on
top
| > if
| > | you didn't.. Kudos to the author.
| > |
| > | L-E
| > |
| > |
| > |
| >
|
|
|

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      11-03-2005
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: <#(E-Mail Removed)>
<(E-Mail Removed)>
<OF$(E-Mail Removed)>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: http://www.velocityreviews.com/forums/(E-Mail Removed) (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: <(E-Mail Removed)>
| 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.prot ocol,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" <(E-Mail Removed)>
| | References: <#(E-Mail Removed)>
| <(E-Mail Removed)>
| | 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$(E-Mail Removed)>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: 213.160.225.168
| | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.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]" <(E-Mail Removed)> wrote in message
| | news:(E-Mail Removed)...
| | > 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" <(E-Mail Removed)>
| | > | From: "Lars-Erik Aabech" <(E-Mail Removed)>
| | > | 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: <#(E-Mail Removed)>
| | > | 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!tk2msft ngp13.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/is...n/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("someIdIKnowE xist");
| | > |
| | > | // 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?
| | > |
| | > | Hope you can help! This method is awesome! Go read that article on
| top
| | > if
| | > | you didn't.. Kudos to the author.
| | > |
| | > | L-E
| | > |
| | > |
| | > |
| | >
| |
| |
| |
|
|

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
is it possible to access jscript objects from shdocvw hosted ie instance ? Ersin Gençtürk ASP .Net 0 10-09-2005 06:59 PM
shdocvw =?Utf-8?B?am9zZQ==?= ASP .Net 1 06-04-2005 04:08 PM
Controlling Internet Explorer from a java application, the SHDocVw.InternetExplorer object or something similar Richard Bell Java 19 02-20-2004 01:21 PM
Using SHDocVW-InternetExplorer quantum ASP .Net 0 02-02-2004 09:50 PM
shdocvw.internetexplorer object help Ryan Clark ASP .Net 3 02-02-2004 09:28 PM



Advertisments