Jump to content

Checking a Webpage status


Recommended Posts

  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi All!

I need some assistance again. I was able to complete my original test script using Internet Explorer 8.0 but I found out some not so stable things about IE 8.0 that it hangs,stops working etc. Basically Microsoft from what I read on the internet about this issue, is not going to support 8.0 on XP platform with any bug fixs for these problems. I am not able to run any loop type tests using IE8.0 and Autoit atleast for this project where some restart of the product is required. In any case many users have suggested to use Mozilla Firefox instead. I have looked at the FF.au3 help and examples. I switched my existing script over to using Mozilla Firefox as the platform for my loop testing. Below is what I found to use for checking the webpages but this does not allow using frames again as in IE8.0. I see on the console the following message. How do I do the reading of the pages using frames with Mozilla Firefox as in IE8.0 if the browser does not support it? In the below code I could have just used one _FFReadHTML but I am just seeing the difference between the different options allowed. I will probably only need one _FFReadHTML.

Any recommendations are greatly appreciated

jodayautoit.

console output

body topmargin="1" leftmargin="1">
<p>This page uses frames, but your browser doesn't support them. <br>
These pages can be best viewed in Internet Explorer 4.xx and Netscape 4.xx at resolution 1024x768 
</p>

_WinWaitActivate("Login Page - Mozilla Firefox", "")
    MouseClick("left", 45, 240, 1)
    Sleep(2000)
    If @error = 0 Then
        Sleep(2000)
        $sHTML = _FFReadHTML("html", 8)
        If Not @error Then ;Msgbox(64, "Sourcecode", StringLeft($sHTML, 1000))
            ConsoleWrite("Page body has been read" & @LF)
        EndIf
        ; filtered source-code
        $sHTML = _FFReadHTML("html", 7)
        If Not @error Then ;Msgbox(64, "Sourcecode", StringLeft($sHTML, 1000))
            ConsoleWrite("Page sourcecode has been read" & @LF)
        EndIf
    EndIf

    Local $Text = "Login"; change this to something on the page
    If StringInStr($sHTML, $Text, 2) <> 0 Then
        ;MsgBox(64, "Source code", "Passed:")
        ConsoleWrite("Pass" & @LF)
    Else
        ;MsgBox(64, "Source code", "Failed :" & @LF)
        ConsoleWrite("Failed" & @LF)
    EndIf
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...