Sign in to follow this  
Followers 0
KlemsonGuy

IE.au3 and ASP.net

5 posts in this topic

I'm having a little bit of trouble getting the _IEClickLinkByText to work with an asp.net page. When I try the following code, I am able to get everything to work except that one command. If I pull up the page and save all of the source code as HTML to my local hard drive and then run the script, it works without an issue. Is one of the limitiations that it will not work with a page written in asp.net? Here is my code:

$oIE = _IECreate()

_IENavigate($oIE, "http://par", 1)

$oMenuFrame = _IEFrameGetObjByIndex($oIE, 0); get a reference to the menu frame

_IEClickLinkByText($oMenuFrame,"Administer Place Group", 0, 1)

Also, just a side question, since I have the browser object stored in the $oIE object variable, is there a way to maximize the window without using the text in the title bar (as in the WinSetState command)?

Share this post


Link to post
Share on other sites



"Welcome to Autoit 1-2-3" has great examples..and

IE.au3 Builder can help you with examples and reading source-tags etc

all in my signature below

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

"Welcome to Autoit 1-2-3" has great examples..and

IE.au3 Builder can help you with examples and reading source-tags etc

all in my signature below

8)

It's not really that I'm having a problem understanding how to use it. It works just fine when the page is standard HTML. It doesn't seem to find the link, however, when the page is an asp.net page (extension of aspx). Does the script treat them differently?

Share this post


Link to post
Share on other sites

I'm having a little bit of trouble getting the _IEClickLinkByText to work with an asp.net page. When I try the following code, I am able to get everything to work except that one command. If I pull up the page and save all of the source code as HTML to my local hard drive and then run the script, it works without an issue. Is one of the limitiations that it will not work with a page written in asp.net? Here is my code:

$oIE = _IECreate()

_IENavigate($oIE, "http://par", 1)

$oMenuFrame = _IEFrameGetObjByIndex($oIE, 0); get a reference to the menu frame

_IEClickLinkByText($oMenuFrame,"Administer Place Group", 0, 1)

Also, just a side question, since I have the browser object stored in the $oIE object variable, is there a way to maximize the window without using the text in the title bar (as in the WinSetState command)?

There should be no reason that this would not work with an aspx page. Once the page has been rendered, the browser does not know or care that it is ASP.net rather than simply HTML. Whatever your problem is, it is not because it is aspx.

Here's how to get a handle for an IE window and then maximize it:

#include <IE.au3>

$oIE = _IECreate()
$hHWnd = _IEGetProperty($oIE, "hwnd"); get handle

; This next line won't be needed in the next IE.au3 release
If Not IsHWND($hHWnd) Then $hHWnd = HWnd($hHWnd); convert to handle variant

WinSetState($hHWnd, "", @SW_MAXIMIZE); maximize

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

There should be no reason that this would not work with an aspx page. Once the page has been rendered, the browser does not know or care that it is ASP.net rather than simply HTML. Whatever your problem is, it is not because it is aspx.

Here's how to get a handle for an IE window and then maximize it:

#include <IE.au3>

$oIE = _IECreate()
$hHWnd = _IEGetProperty($oIE, "hwnd"); get handle

; This next line won't be needed in the next IE.au3 release
If Not IsHWND($hHWnd) Then $hHWnd = HWnd($hHWnd); convert to handle variant

WinSetState($hHWnd, "", @SW_MAXIMIZE); maximize

Dale

Thanks for the assistance on maximizing the window. I figured out the issue. To put it simply, the issue is that I'm an idiot. :o I didn't take notice that whoever developed this page, put a frame inside a frame for no reason whatsoever. Sorry for the headache.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0