Jump to content

How to put Wait time in Internet Explorer


Recommended Posts

Hi All,

;Input useful files
#include <Process.au3>
#include <GuiConstantsEx.au3>
#include <IE.au3>
#include <GuiEdit.au3>


Opt('MustDeclareVars', 1)



_Main()

Func _Main()
    Local $hGUI, $destination, $font, $UserInput, $UserPass, $UserID, $button_submit, $msg, $oIE, $n
    
    $hGUI = GUICreate("Norsker Skogindustrier System v.1.1", 400, 250)
    $font = "Comic Sans MS"  ;==> Font changes
    
    $destination = ".\Image\AutoIT.bmp" 
    GUISetFont(9, 400, 1, $font)
    GUICtrlCreatePic($destination,10,5,380,60)  ;==> Creating pics of autosystem

    ;=======================================================================================
    ;Creating design format for input 
    ;=======================================================================================
    
    $UserInput = GUICtrlCreateGroup("User Input",40,80,320,150)
    GUICtrlCreateLabel("Domain User ID :", 50, 100,180,20)
    $UserID = GUICtrlCreateInput("",150,100,200,20)
    GUICtrlCreateLabel("Domain Password :", 50, 140,180,20)
    $UserPass = GUICtrlCreateInput("", 150, 140, 200, 20, $ES_PASSWORD)
    
    $button_submit = GUICtrlCreateButton("Submit", 240, 180, 110, 30)
    
    GUISetState()
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $button_submit
                
                $oIE = _IECreate ("XXX", 0)
                _IELoadWait ($oIE)
                Send(GUICtrlRead($UserID))
                Send("{TAB}")
                Send(GUICtrlRead($UserPass))
                Send("{TAB}")
                Send("{ENTER}")
                WinWait("Windows Internet Explorer") (This is not working)
                MsgBox(1,"Loaded","Loaded")
                ;sleep(50000)
                ;Send("{TAB 25}")
                ;Send("{ENTER}")
                ;Send("{TAB 5}")
                ;Send("{ENTER}")
                ;sleep(10000)
                ;Send("{TAB 1}")
                ;Send("NSI")
                ;Send("{TAB 42}")
                ;Send("{ENTER}")
                ;sleep(10000)
                ;Send("{TAB 38}")
                ;Send("1/03/2010")
                ;Send("{ENTER}")
                ;ProcessWait("notepad.exe")
                ;msgbox (1,"OK","OK")
            
        EndSelect
    WEnd
EndFunc   ;==>_Main

How do i put wait time in my code

Regards

Pramod

Edited by pramodgn
Link to comment
Share on other sites

like this

;Input useful files
#include <Process.au3>
#include <GuiConstantsEx.au3>
#include <IE.au3>
#include <GuiEdit.au3>


Opt('MustDeclareVars', 1)
;$rc = _RunDos("start https://svcmgt.emea.hp.com/sc/index.do")
;MouseClick("Left",200,45)


_Main()

Func _Main()
    Local $hGUI, $destination, $font, $UserInput, $UserPass, $UserID, $button_submit, $msg, $oIE, $n
    
    $hGUI = GUICreate("Norsker Skogindustrier System v.1.1", 400, 250)
    $font = "Comic Sans MS"  ;==> Font changes
    
    $destination = ".\Image\AutoIT.bmp" 
    GUISetFont(9, 400, 1, $font)
    GUICtrlCreatePic($destination,10,5,380,60)  ;==> Creating pics of autosystem

    ;=======================================================================================
    ;Creating design format for input 
    ;=======================================================================================
    
    $UserInput = GUICtrlCreateGroup("User Input",40,80,320,150)
    GUICtrlCreateLabel("Domain User ID :", 50, 100,180,20)
    $UserID = GUICtrlCreateInput("",150,100,200,20)
    GUICtrlCreateLabel("Domain Password :", 50, 140,180,20)
    $UserPass = GUICtrlCreateInput("", 150, 140, 200, 20, $ES_PASSWORD)
    
    $button_submit = GUICtrlCreateButton("Submit", 240, 180, 110, 30)
    
    GUISetState()
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $button_submit
                
                $oIE = _IECreate ("XXX", 0)
                _IELoadWait ($oIE)
                Send(GUICtrlRead($UserID))
                Send("{TAB}")
                Send(GUICtrlRead($UserPass))
                Send("{TAB}")
                Send("{ENTER}")
                WinWait("Windows Internet Explorer") (This is not working)
                MsgBox(1,"Loaded","Loaded")
                ;sleep(50000)
                ;Send("{TAB 25}")
                ;Send("{ENTER}")
                ;Send("{TAB 5}")
                ;Send("{ENTER}")
                ;sleep(10000)
                ;Send("{TAB 1}")
                ;Send("NSI")
                ;Send("{TAB 42}")
                ;Send("{ENTER}")
                ;sleep(10000)
                ;Send("{TAB 38}")
                ;Send("1/03/2010")
                ;Send("{ENTER}")
                ;ProcessWait("notepad.exe")
                ;msgbox (1,"OK","OK")
            
        EndSelect
        Sleep ( 10 )
    WEnd
EndFunc   ;==>_Main

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

like this

;Input useful files
#include <Process.au3>
#include <GuiConstantsEx.au3>
#include <IE.au3>
#include <GuiEdit.au3>




_Main()

Func _Main()
    Local $hGUI, $destination, $font, $UserInput, $UserPass, $UserID, $button_submit, $msg, $oIE, $n
    
    $hGUI = GUICreate("Norsker Skogindustrier System v.1.1", 400, 250)
    $font = "Comic Sans MS"  ;==> Font changes
    
    $destination = ".\Image\AutoIT.bmp" 
    GUISetFont(9, 400, 1, $font)
    GUICtrlCreatePic($destination,10,5,380,60)  ;==> Creating pics of autosystem

    ;=======================================================================================
    ;Creating design format for input 
    ;=======================================================================================
    
    $UserInput = GUICtrlCreateGroup("User Input",40,80,320,150)
    GUICtrlCreateLabel("Domain User ID :", 50, 100,180,20)
    $UserID = GUICtrlCreateInput("",150,100,200,20)
    GUICtrlCreateLabel("Domain Password :", 50, 140,180,20)
    $UserPass = GUICtrlCreateInput("", 150, 140, 200, 20, $ES_PASSWORD)
    
    $button_submit = GUICtrlCreateButton("Submit", 240, 180, 110, 30)
    
    GUISetState()
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $button_submit
                
                $oIE = _IECreate ("XXX", 0)
                _IELoadWait ($oIE)
                Send(GUICtrlRead($UserID))
                Send("{TAB}")
                Send(GUICtrlRead($UserPass))
                Send("{TAB}")
                Send("{ENTER}")
                WinWait("Windows Internet Explorer") (This is not working)
                MsgBox(1,"Loaded","Loaded")
                ;sleep(50000)
                ;Send("{TAB 25}")
                ;Send("{ENTER}")
                ;Send("{TAB 5}")
                ;Send("{ENTER}")
                ;sleep(10000)
                ;Send("{TAB 1}")
                ;Send("NSI")
                ;Send("{TAB 42}")
                ;Send("{ENTER}")
                ;sleep(10000)
                ;Send("{TAB 38}")
                ;Send("1/03/2010")
                ;Send("{ENTER}")
                ;ProcessWait("notepad.exe")
                ;msgbox (1,"OK","OK")
            
        EndSelect
        Sleep ( 10 )
    WEnd
EndFunc   ;==>_Main

if i put sleep (10) then also its not working, basic problem is after logging into internet explore it will navigate into different internet explore, first IE_Wait work after that what should i do to keep same window wait till it is being processed.

thanks

pramod

Link to comment
Share on other sites

Arg !!

And this ?

While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $button_submit
                $oIE = _IECreate ("XXX", 0)
                _IELoadWait ($oIE)
                Send(GUICtrlRead($UserID))
                Send("{TAB}")
                Send(GUICtrlRead($UserPass))
                Send("{TAB}")
                Send("{ENTER}")
         EndSelect      
        $_WinWait = WinWait("Windows Internet Explorer", 3 ) ; Perhaps with a title more precise...
        If $_WinWait Then MsgBox(1,"Loaded","Loaded")
    WEnd

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

$_WinWait = WinWait("ServiceCenter Windows Internet Explorer", 3 ); title 
    If $_WinWait Then MsgBox(1,"Loaded","Loaded")

still now working

;Input useful files
#include <Process.au3>
#include <GuiConstantsEx.au3>
#include <IE.au3>
#include <GuiEdit.au3>

_Main()

Func _Main()
    Local $hGUI, $destination, $font, $UserInput, $UserPass, $UserID, $button_submit, $msg, $oIE, $n, $_WinWait
    
    $hGUI = GUICreate("Norsker Skogindustrier System v.1.1", 400, 250)
    $font = "Comic Sans MS"  ;==> Font changes
    
    $destination = ".\Image\AutoIT.bmp" 
    GUISetFont(9, 400, 1, $font)
    GUICtrlCreatePic($destination,10,5,380,60)  ;==> Creating pics of autosystem

    ;=======================================================================================
    ;Creating design format for input 
    ;=======================================================================================
    
    $UserInput = GUICtrlCreateGroup("User Input",40,80,320,150)
    GUICtrlCreateLabel("Domain User ID :", 50, 100,180,20)
    $UserID = GUICtrlCreateInput("",150,100,200,20)
    GUICtrlCreateLabel("Domain Password :", 50, 140,180,20)
    $UserPass = GUICtrlCreateInput("", 150, 140, 200, 20, $ES_PASSWORD)
    
    $button_submit = GUICtrlCreateButton("Submit", 240, 180, 110, 30)
    
    GUISetState()
    While 1
        $msg = GUIGetMsg()
        Select
            Case $msg = $GUI_EVENT_CLOSE
                Exit
            Case $msg = $button_submit
                
                $oIE = _IECreate ("https://svcmgt.emea.hp.com/sc/index.do", 0)
                _IELoadWait ($oIE)
                Send(GUICtrlRead($UserID))
                Send("{TAB}")
                Send(GUICtrlRead($UserPass))
                Send("{TAB}")
                Send("{ENTER}")
                ;sleep(50000)
                ;Send("{TAB 25}")
                ;Send("{ENTER}")
                ;Send("{TAB 5}")
                ;Send("{ENTER}")
                ;sleep(10000)
                ;Send("{TAB 1}")
                ;Send("NSI")
                ;Send("{TAB 42}")
                ;Send("{ENTER}")
                ;sleep(10000)
                ;Send("{TAB 38}")
                ;Send("1/03/2010")
                ;Send("{ENTER}")
                ;ProcessWait("notepad.exe")
                ;msgbox (1,"OK","OK")
                
            ;----------------------------------------------------------
            ; Navigate to Menu
            ;----------------------------------------------------------
        EndSelect
    WEnd
    $_WinWait = WinWait("ServiceCenter Windows Internet Explorer", 3 );(This is not working)
    If $_WinWait Then MsgBox(1,"Loaded","Loaded")
EndFunc   ;==>_Main
Link to comment
Share on other sites

Great, and sorry i was a bit slow to undestand what you want !

certainly due to age ! Posted Image

I want to login to one web - base application, where u have to punch in your user name and password after submit wait till the web base application is fully loaded (I have put IE_Wait for that). Then after submitting it should it will redirect to IE title "ServiceCenter Windows Internet Explorer". Now this will also take some time so am trying to put wait here (This is where am not able to code) and next step is to put 25 tab and click on to that button.

How to put _IELoadWait ($oIE) wait time after redirecting??????

Edited by pramodgn
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...