Sign in to follow this  
Followers 0
tork140

Script will not run in Win7 - IE 8.0.7601

2 posts in this topic

Hello all,

I've been using Autoit and the Forums since 2006 with great success hence 0 posts. I can usually find the answer or a workaround to any issue that arises except today.

I created a script that will open an IE Page and populates the SSN Field on the page. It then clicks on a lookup button and so on. When I was building the script, I used XP with IE 8.0.6001 and it worked perfectly. I go to demo the executable for my client on their machine (Win7 - IE 8.0.7601) and the script stops @ $oIE = _IECreate ("http://intranetsite.aspx") - _IELoadWait ($oIE). Maybe I am making this more difficult than need be I have tried the following:

  • Turn on compatibility for the intranet site.
  • Added console writes.
  • Commented out the _IELoadwait.
  • Manually opened the window.
  • Added an _IEAttach ($oIE) statement.
  • Made myself an Administrator.
  • Checked all MS Logs.
The code in question is at the bottom in red. Any assistance with this would be greatly appreciated as I am at my wits end. Thanks.

#include <IE.au3>

Opt("WinWaitDelay",100)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

#include <GUIConstantsEx.au3>

#include <ButtonConstants.au3>

Global $checkCN[11] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0], $ssnx, $ssn, $btn, $oIE, $pos = 90, $i, $username, $checksum, $clip, $username = @UserName, $type

LOCAL $msg

; CLOSE ANY WINDOWS THIS SCRIPT WILL NEED

Close_Previous ()

;CLEAR CLIPBOARD

;ClipPut("")

GUICreate("Barcode Creator", 210, 80)

GUICtrlCreateLabel("Is the employee in SAP?", 10, 10)

$SAP = GUICtrlCreateButton("Yes", 10, 50, 50, 20)

$NotSAP = GUICtrlCreateButton("No", 80, 50, 50, 20)

$ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)

; Set accelerators for Ctrl+y and Ctrl+n

Dim $AccelKeys[2][2]=[["^y", $SAP], ["^n", $NotSAP]]

GUISetAccelerators($AccelKeys)

GUISetState() ; display the GUI

Do

$msg = GUIGetMsg()

Select

Case $msg = $SAP

$type = ("SAP")

TopGUI ()

; BlockInput(1) ; DISABLE MOUSE AND KEYBOARD

iescreenload ()

populate_ie ()

wait_for_print_bar ()

generate_barcode_sheets_and_print ()

; BlockInput(0) ; ENABLE MOUSE AND KEYBOARD

Close_Previous ()

Exit

Case $msg = $NotSAP

$type = ("NOTSAP")

iescreenload ()

notsap_wait ()

wait_for_print_bar ()

get_last_name ()

generate_barcode_sheets_and_print ()

; BlockInput(0) ; ENABLE MOUSE AND KEYBOARD

Close_Previous ()

Exit

Case $msg = $ExitID

Exit

Case $msg = $GUI_EVENT_CLOSE

EXIT

EndSelect

Until $msg = $GUI_EVENT_CLOSE Or $msg = $ExitID

EXIT

Func TopGUI()

LOCAL $msg

ConsoleWrite("TopGUI" & @CRLF)

GUICreate("Barcode Generator", 250, 325) ; CREATE A GUI BOX

$ssnx = 0

$ssn = GUICtrlCreateInput("SSN", 10, 10, 100, 20)

$checkCN[1] = GUICtrlCreateCheckbox("Active I-9", 10, 30, 120, 20) ; CREATE CHECKBOX IN GUI

$checkCN[2] = GUICtrlCreateCheckbox("Benefits", 10, 50, 120, 20) ; CREATE CHECKBOX IN GUI

$checkCN[3] = GUICtrlCreateCheckbox("Employee Relations", 10, 70, 120, 20) ; CREATE CHECKBOX IN GUI

$checkCN[4] = GUICtrlCreateCheckbox("Inactive I-9", 10, 90, 120, 20) ; CREATE CHECKBOX IN GUI

$checkCN[5] = GUICtrlCreateCheckbox("Miscellaneous/Correspondence", 10, 110, 190, 20) ; CREATE CHECKBOX IN GUI

$checkCN[6] = GUICtrlCreateCheckbox("Performance Evaluation", 10, 130, 150, 20) ; CREATE CHECKBOX IN GUI

$checkCN[7] = GUICtrlCreateCheckbox("Personnel Action Forms", 10, 150, 150, 20) ; CREATE CHECKBOX IN GUI

$checkCN[8] = GUICtrlCreateCheckbox("Recruitment", 10, 170, 120, 20) ; CREATE CHECKBOX IN GUI

$checkCN[9] = GUICtrlCreateCheckbox("References/Background Check", 10, 190, 190, 20) ; CREATE CHECKBOX IN GUI

$checkCN[10] = GUICtrlCreateCheckbox("Training Certificates", 10, 210, 120, 20) ; CREATE CHECKBOX IN GUI

$btn = GUICtrlCreateButton("Ok", 10, 240, 60, 20) ; CREATE THE OKAY BUTTON IN GUI

GUISetState() ; will display a dialog box with checkboxes

;WAIT FOR THE OKAY BUTTON TO BE PRESSED

$msg = 0

While $msg <> $GUI_EVENT_CLOSE

$msg = GUIGetMsg()

Select

Case $msg = $btn

ExitLoop

EndSelect

WEnd

$ssnx = GUICtrlRead($ssn)

EndFunc

Func iescreenload()

ConsoleWrite("iescreenload" & @CRLF)

;OPEN CRYSTAL REPORT INPUT SCREEN

$oIE = _IECreate ("http://intranetsite.aspx")

_IELoadWait ($oIE)

send("{altdown}{space}x{altup}")

ConsoleWrite("finished waiting" & @CRLF)

;_IELoadWait ($oIE)

;_IEAction ($oIE, "enable")

;_IEAttach ($oIE)

; Maximize Window

WinSetState("Barcoder - Windows Internet Explorer", "", @SW_MAXIMIZE)

Share this post


Link to post
Share on other sites



Do you get an error message or do you get a message from IE that the page can't be loaded? I can't reproduce, because I don't have intranetsite.aspx and because the script posted is not complete (maximum post size?).

I can however confirm that the following code snippet does work on Windows 7, Internet Explorer 8.0.7601.17514.

#include <IE.au3>

$oIE = _IECreate ("http://www.google.com")

_IELoadWait ($oIE)

Share this post


Link to post
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
Sign in to follow this  
Followers 0