473,322 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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

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? :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
Nov 19 '05 #1
4 3264
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" <la******@newsgroup.nospam>
| From: "Lars-Erik Aabech" <la******@newsgroup.nospam>
| 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: <#U**************@tk2msftngp13.phx.gbl>
| 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? :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
|
|
|

Nov 19 '05 #2
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]" <st*****@online.microsoft.com> wrote in message
news:BT**************@TK2MSFTNGXA01.phx.gbl...
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" <la******@newsgroup.nospam>
| From: "Lars-Erik Aabech" <la******@newsgroup.nospam>
| 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: <#U**************@tk2msftngp13.phx.gbl>
| 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? :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
|
|
|

Nov 19 '05 #3
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" <la******@newsgroup.nospam>
| References: <#U**************@tk2msftngp13.phx.gbl>
<BT**************@TK2MSFTNGXA01.phx.gbl>
| 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**************@tk2msftngp13.phx.gbl>
| 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]" <st*****@online.microsoft.com> wrote in message
| news:BT**************@TK2MSFTNGXA01.phx.gbl...
| > 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" <la******@newsgroup.nospam>
| > | From: "Lars-Erik Aabech" <la******@newsgroup.nospam>
| > | 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: <#U**************@tk2msftngp13.phx.gbl>
| > | 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? :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
| > |
| > |
| > |
| >
|
|
|

Nov 19 '05 #4
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: <#U**************@tk2msftngp13.phx.gbl>
<BT**************@TK2MSFTNGXA01.phx.gbl>
<OF**************@tk2msftngp13.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online.microsoft.com (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: <D5**************@TK2MSFTNGXA01.phx.gbl>
| 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" <la******@newsgroup.nospam>
| | References: <#U**************@tk2msftngp13.phx.gbl>
| <BT**************@TK2MSFTNGXA01.phx.gbl>
| | 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**************@tk2msftngp13.phx.gbl>
| | 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]" <st*****@online.microsoft.com> wrote in message
| | news:BT**************@TK2MSFTNGXA01.phx.gbl...
| | > 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" <la******@newsgroup.nospam>
| | > | From: "Lars-Erik Aabech" <la******@newsgroup.nospam>
| | > | 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: <#U**************@tk2msftngp13.phx.gbl>
| | > | 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? :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
| | > |
| | > |
| | > |
| | >
| |
| |
| |
|
|

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Hautzendorfer | last post by:
Hello, I'm currently working on some printing stuff: I have to print out several .xml files using a stylesheet. Therefor I choose the Internetexplorer PlugIn via SHDocVW. My problem: After...
3
by: Tom | last post by:
Hi, I wrote the following code in a c# winform. InternetExplorer ie = new InternetExplorer(); ie.Navigate(url, ref o, ref o, ref o, ref o); The url can be passed to the IE. However, how...
2
by: Ryan Clark | last post by:
I'm trying to finish up an ASP.Net application but one requirement has got me stumped. I have a databound listbox that contains my information. The requirement is to open up another instance of...
0
by: Afigels | last post by:
I have an asp.net application that has references to MSHTML and SHDocVw to automate InternetExplorer from asp.net page. It works fine at the originating PC where the page was coded and compiled. ...
0
by: mammucion | last post by:
Trying to automate processing 80,000 data sets through 15 web pages. Application URL creates a new IE instance in which runs first a login form and then runs the rest of the pages in the new...
4
by: Dick Sutton | last post by:
I am so close, yet oh so far! Here's the problem: I want to load a string variable that contains HTML into an instance of SHDocVw.InternetExplorer. Here's what I have so far: Function...
0
by: Fab | last post by:
Hi, In a VS 2003 project, i use the Microsoft Web Browser (shdocvw32.dll). So in the References tab of the Solution Explorer i have : AxSHDocVw SHDocVw Microsoft.mshtml When i copy the...
8
by: Ludwig Wittgenstein | last post by:
Hi, all. How can i hook up an InternetExplorer object to a WebBrowser control that I have in my windows form. Basically what I want to do is automate the WebBrowser control via the...
0
by: =?Utf-8?B?bXQ=?= | last post by:
I am writing a browser toolstrip bar that sits in IE. How do I set a cookie in the browser for a specific domain before the user navigates to that domain. I only have access to IE as an...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.