Jump to content

How to catch error messages from the browser?


 Share

Recommended Posts

Hi,

im new and try a bit with autoit ;)

I want to catch error messages like "Die Seite kann nicht angezeigt werden." -> "The page cant be shown." than i want to close the browser. I tried _IEErrorHandlerRegister but whitout success.

Can anybody help? thx

Link to comment
Share on other sites

Hi,

im new and try a bit with autoit ;)

I want to catch error messages like "Die Seite kann nicht angezeigt werden." -> "The page cant be shown." than i want to close the browser. I tried _IEErrorHandlerRegister but whitout success.

Can anybody help? thx

EDIT:

now i do it like that:

Opt("WinTitleMatchMode",2) 
    IF WinGetTitle("active") = "Server nicht gefunden" THEN
    ;MsgBox(0,"", WinGetTitle("active"))
        _writeLog($DateiInhalt[$x])
        Exit
    EndIf

The problem ist that the script stops after the first error window, but it should go on with the next window.

Link to comment
Share on other sites

Does the error appear in the body of the browser (use _IEBodyRead*) or in a popup window?

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

Does the error appear in the body of the browser (use _IEBodyRead*) or in a popup window?

Dale

Hi,

body error: "Die Seite kann nicht angezeigt werden." -> "Page cant be shown"

title error: "Server nicht gefunden" ->"Found no server"

testet both with: Opt("WinTitleMatchMode",4) but it doesnt function

Link to comment
Share on other sites

You can access the browser body with the _IEBodyRead* functions.

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

You can access the browser body with the _IEBodyRead* functions.

Dale

Hi,

ok i tried it an it looks fine.

$text = _IEBodyReadText($oIE)
    IF $text = "Die Seite kann nicht angezeigt werden" THEN
        _writeLog($DateiInhalt[$x])
        Msgbox(0,"HTML Read",$text)
        EXIT
    ENDIF

But how can i compare the result of the function? what i use above doesnt function.

Link to comment
Share on other sites

ok i tried it an it looks fine.

But how can i compare the result of the function?

what i use above doesnt function.

I don't understand what you are trying to say.

Perhaps you should use

IF StringInStr($text, "Die Seite kann nicht angezeigt werden") THEN

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

I don't understand what you are trying to say.

Perhaps you should use

IF StringInStr($text, "Die Seite kann nicht angezeigt werden") THEN

Dale

hi

i solved the problem like this

Func _checkTitle($name)

ConsoleWrite(WinGetTitle("") & @LF)

If WinGetTitle("") = $error Then

_WriteLog($name)

;MsgBox(0, "", "Error")

Exit (0)

EndIf

EndFunc

thx for your fast help

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...