Jump to content

Search the Community

Showing results for tags 'loadwait'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I asked this question in another post, but everyone ignored it, so I will ask it here in a new post... sorry for the redundency... I have a web page that is slow to load at times, and I work in frames. I've tried _LoadWait, but it returns before all the frames load, and the objects don't get created because it can't find the paths to the objects within the frames. If I put just sleep commands in it works but takes too long. I'd like it to return to the user after the page loads 100 % completely and my commands don't fail. I've been doing it by checking isobj() $Count = 0 Do $Count+=1 $oIE = _IEAttachHDL($DQMwHndl) Sleep(200) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oIE) This works, but takes up CPU time checking a lot until the page loads. ($DQMwHndl is the handle to the IECREATE(web address) - _IEAttachHDL is a shorned version only using HWND's) After the attach, I have to check for the frame, and form, using the same logic, or sometimes my script fails, as it cant get past all that stuff. The short version: $oIE = _IEAttachHDL($DQMwHndl) $oIFrame = _IEFrameGetObjByName($oIE, "ifmPage") $oForm = _IEFormGetObjByName($oIFrame, "frmADT") $oSubmit = _IEGetObjByName($oForm, "button2") $oSearchCompID = _IEFormElementGetObjByName($oForm, $CompanyPicker) _IEFormElementSetValue($oSearchCompID,$ClientFacility) _IEAction($oSubmit, "click") the long version is what works, with each line above having a loop to check IsObj(). Basically because _loadwait() really doesn't work well. So each time I click a link, i have to verify all the objects again. Func _ADTDefs() If WinExists($DQMwHndl) Then $oIE = _IEAttachHDL($DQMwHndl) _IELinkClickByIndex ($oIE, $ClickADTDefSearch);link 43 search ADT defs. Sleep(200) $Count = 0 Do $Count+=1 $oIE = _IEAttachHDL($DQMwHndl) Sleep(200) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oIE) Sleep(200) $Count = 0 Do $Count+=1 $oIFrame = _IEFrameGetObjByName($oIE, "ifmPage") Sleep(200) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oIFrame) Sleep(200) $Count = 0 Do $Count+=1 $oForm = _IEFormGetObjByName($oIFrame, "frmADT") Sleep(200) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oForm) Sleep(200) $Count = 0 Do $Count+=1 $oSubmit = _IEGetObjByName($oForm, "button2") Sleep(200) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oSubmit) Sleep(300) $Count = 0 Do $Count+=1 $oSearchCompID = _IEFormElementGetObjByName($oForm, $CompanyPicker);this is the call that is failing... if @error then $Temp = 0;nothing Sleep(400) If $Count > 10 Then MsgBox(0,$DQMerror1,$DQMerror2) Return EndIf Until IsObj($oSearchCompID) Sleep(400) _IEFormElementSetValue($oSearchCompID,$ClientFacility) Sleep(500) _IEAction($oSubmit, "click") EndIf EndFunc Is there a better way to make sure each object is a valid object other than what I preset here (too lengthy-not a clean script, too much CPU time) or a better way to ensure the page is really loaded instead of relying on LoadWait that will allow the short version to run properly? Thanks in Advance!
×
×
  • Create New...