Jump to content

IE - Router login


Biskup
 Share

Recommended Posts

Still doesn't working. IE's open, but LOGIN & PASW are still empty. :P

#include <IE.au3>

$oIE = _IECreate("http://192.168.1.1/setup.cgi?todo=debug", 0, 1, 1)
; here must be smth wrong, I think.
MsgBox(0, "Wait", "Press OK when ready...")
You need to explain in more detail.

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

Link to comment
Share on other sites

AH!!! Ok! That's the missing piece of the puzzle.

The way you are doing this, control will not return to your script until after the login box is dismissed. The login box does not dismiss because the code to do it is later in your script.

You need to bring up the webpage without going directly to the login box and then activate an element on that webpage that will bring up the login box, using a mouse click or a keyboard command.

Please see the second example for the function _IEaction

Alternately, you can start using the run command and have it open at URL and then just manipulate the login box with the standard win and control commands.

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

Link to comment
Share on other sites

Well, to take the first route, you probably need to start with

$oIE = _IECreate("http://192.168.1.1", 0, 1, 1)

instead of

$oIE = _IECreate("http://192.168.1.1/setup.cgi?todo=debug", 0, 1, 1)

Since I don't have your setup I cannot guess.

For the second option, use ShellExecute("http://192.168.1.1/setup.cgi?todo=debug") (rather than Run like I said before) and then leave the IE commands out of it all together.

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

Link to comment
Share on other sites

Right, new problem:

I can't activate this window

Window

IT MUST be activated, and program must click on OK button ( Button2 ). I've checked that WinActivate with some IF->THEN loop, and there's no response. That window isn't activated.

#include <IE.au3>

$oIE = _IECreate ("http://192.168.1.1/setup.cgi?todo=debug",0,1,1)

Sleep(2000)
WinActivate("Połącz z 192.168.1.1", "") 

If WinActive("Połącz z 192.168.1.1") Then
    MsgBox(0, "", "Window was active")
EndIf

ControlClick("Połącz z 192.168.1.1", "", "Button2")

Sleep(500)
_IELoadWait ($oIE)
_IEQuit ($oIE)
Sleep(700)

Tell me what I do wrong? I'm slowly going crazy.. :P

Biskup

Link to comment
Share on other sites

Thant's the same code you had before that wan't getting past the _IECreate -- what is different now?

Put

#AutoIt3Wrapper_run_debug_mode=Y

in your code so you can follow the execution.

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

Link to comment
Share on other sites

Thant's the same code you had before that wan't getting past the _IECreate -- what is different now?

To run DEBUG MODE, you must run http://192.168.1.1/setup.cgi?todo=debug on your browser; then log in and that's all.

Runing http://192.168.1.1/ only is useless, why? Becouse there appear THE SAME window as in the link above. all in all... that window ( with username and password ) must be activate...

Alternately, you can start using the run command and have it open at URL and then just manipulate the login box with the standard win and control commands.

I've tried. It opens my FireFox and there's similar login window as in IE.

Biskup

Link to comment
Share on other sites

Trying to guide you through it is taking too long. Sorry I wan't able to find the words that worked for you as we went along.

Here you go:

#include <IE.au3>

ShellExecute("http://192.168.1.1/setup.cgi?todo=debug")
WinWaitActive("Polacz z 192.168.1.1")
ControlSend("Polacz z 192.168.1.1", "", "Edit2", "admin")
ControlSend("Polacz z 192.168.1.1", "", "Edit3", "pasw")
ControlClick("Polacz z 192.168.1.1", "", "Button2")

Sleep(2000)
Run("telnet 192.168.1.1")
WinWait("telnet 192.168.1.1", "", 2)

Send("reboot {ENTER}")

Sleep(2000)
WinKill("telnet 192.168.1.1", "")

You'll need to figure out how to close the browser.

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

Link to comment
Share on other sites

**EDIT**

forgot to add ", "WindowTitle"" After $CloseBrowser

**EDIT**

Assuming that Dale answered the rest that you need and all you need to do now is close the browser, use on of the two following codes. The first assumes that you know the webpage title. www.yahoo.com is Yahoo! -just look in the upper left when the page is loaded. -If you don't know it and CANT find it then use the second code -but the second will close the first IE it finds, so you can only have one open . . . .

CODE
#include <IE.au3>

$oIE = _IEAttach("Yahoo!")

$oIE.quit ()

CODE
#include <IE.au3>

$CloseBrowser = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\", "Window Title")

$oIE = _IEAttach($CloseBrowser, "WindowTitle")

$oIE.quit ()

Edited by Hatcheda
Link to comment
Share on other sites

He provided a screenshot that showed no document title and nothing in the address field. It's going to take some experimentation to see how to close it.

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...