Jump to content

Recommended Posts

Posted

I have kept below line to wait for IE to load the site completely and continue.

_IELoadWait($oIE)

 

But, the code is continuing without waiting for it and I my execution is failing as the elements are not loaded completely.

Untitled.png

 

Any suggestions for alternate code to wait for the browser to load completely?

 

Posted (edited)

It is from local server page... 

So I think we can't replicate the complete environment here.

But here is the part of code.

 

#include <IE.au3>

#include <Date.au3>
#include <file.au3>


Global $IE,$sBaseURL, $oIE, $mart_IE_user, $mart_IE_password, $mart_IE_email
$IE = ""
$sBaseURL = "http://localhost:18170/"

initIE()

Func initIE($luser = "uday", $lpassword = "password" , $lemail = "robot@test.com")
   $mart_IE_user = $luser
   $mart_IE_password = $lpassword
   $mart_IE_email = $lemail

   $IE = _IECreate("http://www.autoitscript.com/forum/index.php?")
   $oIE = _IEAttach ("", "instance",1);selects ie first instance opened.
   _IEPropertySet($oIE,"Height",@DesktopHeight)
   _IEPropertySet($oIE,"Width",@DesktopWidth)

   gotoMartPage()
   processMart()
   Logging("Completed executing Mart Login and delete process through IE.")
   if _IEQuit($oIE) = 1 then
      Logging("exited IE browser..")
   Else
      Logging("unable to exit IE browser..")
   EndIf
EndFunc
Func gotoMartPage($page = $sBaseURL & "MartAdmin")
   _IENavigate ($oIE, $page)
   _IELoadWait ($oIE)
   Logging("Completed gotoMartPage with page : "&$page)
EndFunc

Func processMart()
   $title = _IEPropertyGet($oIE, "title")
   if not StringCompare($title,"erwin Mart Administrator")=0 then
      ;MsgBox(0,"Page not loaded with heading: ","erwin Mart Administrator")
      Logging("Error: Page Not loading with Heading - erwin Mart Administrator");-------Coming to this line------
      Exit;
   Else
      ;--REmaining part----
   EndIf
EndFunc


Func Logging($sMessage,$sLogFile=@ScriptDir&"\Logging.log")
    If $sMessage = "" Then
        FileWriteLine($sLogFile, "")
    Else
        FileWrite($sLogFile,_NowCalc() & " :: " & $sMessage&@CRLF)
    EndIf
EndFunc

Logging("Error: Page Not loading with Heading - erwin Mart Administrator");-------Coming to this line------

Edited by ur

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
×
×
  • Create New...