Jump to content

Autologin script error?


Recommended Posts

Hi guys,
I am currently programming for my company. The idea is to automatically "tag/track" their progress by automating IE procedures. So basically, I am eliminating their interaction to IE when tracking their progress. I am getting this error on some occasions and I don't know why.

--> IE.au3 T3.0-2 Warning from function _IELoadWait, $_IESTATUS_AccessIsDenied (Cannot verify readyState.  Likely casue: cross-domain scripting security restriction. (-2147024891))

 

The full process is: The executable will automatically log-in the user, check some radiobuttons, write some comments and then press a save button to record their progress, all of these are automated.

The window is hidden and I'll show a part of my code and edit some parts (for privacy). Hope someone can give me help. will appreciate it.

Func TESTING()
    $TagWindow = _IECreate($Url, 0, 0, 1, 1)
    $oForm = _IEFormGetObjByName($TagWindow, "frmLogin")
    $oUser = _IEFormElementGetObjByName($oForm, "txtUserName") ;username
    _IEFormElementSetValue($oUser, $Username)
    Local $oPass = _IEFormElementGetObjByName($oForm, "txtpassword") ;password
    _IEFormElementSetValue($oPass, $Password)
    
    If $oForm.action <> "0" And Not StringInStr($oForm.action, '.php') Then ;submit
        _IEFormSubmit($oForm, 0)
    EndIf
    _IELoadWait($oForm)

    $TagSource = _IEDocReadHTML($TagWindow)
    If StringInStr($TagSource, "Your Login ID/Password may be incorrect") > 0 Then
        MsgBox(262208, "", "Your Login was invalid! Call will be recorded as Untagged. Please tag this call manually.")
        
    Else
        MsgBox(262208, "", "Tagging in progress...", 0.5)

    EndIf

    $TagStart = _IEFormGetObjByName($TagWindow, "FrmEntry")

    If IsObj($TagStart) Then
        If $CallType = "AA" Then
            _IEFormElementRadioSelect($TagStart, "AA", "RadCallDisp", 1, "byValue")
            Sleep(250)
        ElseIf $DnisType = "BB" Then
            _IEFormElementRadioSelect($TagStart, "BB", "RadCallDisp", 1, "byValue")
            Sleep(250)
        EndIf

        _IEFormElementRadioSelect($TagStart, "AAAAAAAAAAA", "RadSaleNonSale", 1, "byValue")
        Sleep(300)
        
        
        $oText = _IEFormElementGetObjByName($TagStart, "txtDNS")
        _IEFormElementSetValue($oText, $TEXT)
        
        
        $oSelect = _IEFormElementGetObjByName($TagStart, "drpCategory")
        $oSelect2 = _IEFormElementGetObjByName($TagStart, "drpSubCategory")
        _IEFormElementOptionSelect($oSelect, $TEXT2, 1, "byText")
        Sleep(300)
        _IEFormElementOptionSelect($oSelect2, $TEXT3, 1, "byText")
        
        
        $oText = _IEFormElementGetObjByName($TagStart, "txtCallComments")
        _IEFormElementSetValue($oText, $TEXT4)
        
        
        Local $oSave = _IEGetObjById($TagStart, "btnSave") ;button save
        _IEAction($oSave, "click")
        
    EndIf
    _IEAction($TagWindow, "quit")
EndFunc

 

 

Link to comment
Share on other sites

30 minutes ago, Danp2 said:

You could add some logging so that you can narrow down where the error is occurring. Just looking at the code, I only see the one instance of _IELoadWait. You may want to try changing it to the following to see if that helps --

_IELoadWait($TagWindow)

 

Thanks! gonna try it.

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