Jump to content

Determine which language my Internet explorer is running.


Recommended Posts

  • Moderators

We would solve it by posting our entire code so the forum could help us :)

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

This is the code.

#Include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <IE.au3>
#Include <MoreFunctions.au3>
#include <ie9-ui-WIN_7 x32.au3>
#include <ie9-ui-WIN_7 x64.au3>

Dim $runAllTests=False, $runFileTests=False, $runViewTests=False, $runEditTests=False, $runFavTests=False, $runToolTests=False, $runHelpTests=False, $runPrntTests=False, $runNavTests=False, $runPlugTests=False

GUICreate("IE9 Automated Testing", 320, 300)
GUICtrlCreateLabel("This Autoit Script automates the testing of nearly all UI components, Navigation and Plugins (Adobe Flash, Adobe Reader and Java).", 10, 10, 300, 50)
$allTestsCB = GUICtrlCreateCheckbox("Run All Tests", 10, 60, 200)
$fileCB = GUICtrlCreateCheckbox("File Menu Tests", 10, 80, 200)
$editCB = GUICtrlCreateCheckbox("Edit Menu Tests", 10, 100, 200)
$viewCB = GUICtrlCreateCheckbox("View Menu Tests", 10, 120, 200)
$favCB = GUICtrlCreateCheckbox("Favorites Menu Tests", 10, 140, 200)
$toolsCB = GUICtrlCreateCheckbox("Tools Menu Tests", 10, 160, 200)
$helpCB = GUICtrlCreateCheckbox("Help Menu Tests", 10, 180, 200)
$printCB = GUICtrlCreateCheckbox("Printing Menu Tests", 10, 200, 200)
$navCB = GUICtrlCreateCheckbox("Navigation Test", 10, 220, 200)
$plugCB = GUICtrlCreateCheckbox("Plugins Test", 10, 240, 200)
$okbutton = GUICtrlCreateButton("OK", 180, 260, 60)
$cancelbutton = GUICtrlCreateButton("Cancel", 245, 260, 60)
GUISetState(@SW_SHOW)
GUICtrlSetState ($allTestsCB, $GUI_CHECKED )
GUICtrlSetState ($fileCB, $GUI_CHECKED )
GUICtrlSetState ($editCB, $GUI_CHECKED )
GUICtrlSetState ($viewCB, $GUI_CHECKED )
GUICtrlSetState ($favCB, $GUI_CHECKED )
GUICtrlSetState ($toolsCB, $GUI_CHECKED )
GUICtrlSetState ($helpCB, $GUI_CHECKED )
GUICtrlSetState ($printCB, $GUI_CHECKED )
GUICtrlSetState ($navCB, $GUI_CHECKED )
GUICtrlSetState ($plugCB, $GUI_CHECKED )

While 1
$msg = GUIGetMsg()

Select
Case $msg = $cancelbutton
Exit
Case $msg = $okbutton
$uiCtrlState = GUICtrlRead($fileCB, 0)
if $uiCtrlState = $GUI_CHECKED Then
$runFileTests=True
Else
$runFileTests=False
EndIf
$uiCtrlState = GUICtrlRead($editCB, 0)
if $uiCtrlState = $GUI_CHECKED Then
$runEditTests=True
Else
$runEditTests=False
EndIf
$uiCtrlState = GUICtrlRead($viewCB, 0)
if $uiCtrlState = $GUI_CHECKED Then
$runViewTests=True
Else
$runViewTests=False
EndIf
$uiCtrlState = GUICtrlRead($favCB, 0)
if $uiCtrlState = $GUI_CHECKED Then
$runFavTests=True
Else
$runFavTests=False
EndIf
$uiCtrlState = GUICtrlRead($toolsCB, 0)
if $uiCtrlState = $GUI_CHECKED Then
$runToolTests=True
Else
$runToolTests=False
EndIf
$uiCtrlState = GUICtrlRead($helpCB, 0)
if $uiCtrlState = $GUI_CHECKED Then
$runHelpTests=True
Else
$runHelpTests=False
EndIf
$uiCtrlState = GUICtrlRead($printCB, 0)
if $uiCtrlState = $GUI_CHECKED Then
$runPrntTests=True
Else
$runPrntTests=False
EndIf
$uiCtrlState = GUICtrlRead($navCB, 0)
if $uiCtrlState = $GUI_CHECKED Then
$runNavTests=True
Else
$runNavTests=False
EndIf
$uiCtrlState = GUICtrlRead($plugCB, 0)
if $uiCtrlState = $GUI_CHECKED Then
$runPlugTests=True
Else
$runPlugTests=False
EndIf

GUIDelete()
ExitLoop
Case $msg = $allTestsCB
$ctrlState = GUICtrlRead($allTestsCB, 0)
if $ctrlState = $GUI_CHECKED Then
GUICtrlSetState ($allTestsCB, $GUI_CHECKED )
GUICtrlSetState ($fileCB, $GUI_CHECKED )
GUICtrlSetState ($editCB, $GUI_CHECKED )
GUICtrlSetState ($viewCB, $GUI_CHECKED )
GUICtrlSetState ($favCB, $GUI_CHECKED )
GUICtrlSetState ($toolsCB, $GUI_CHECKED )
GUICtrlSetState ($helpCB, $GUI_CHECKED )
GUICtrlSetState ($printCB, $GUI_CHECKED )
GUICtrlSetState ($navCB, $GUI_CHECKED )
GUICtrlSetState ($plugCB, $GUI_CHECKED )
ElseIf $ctrlState = $GUI_UNCHECKED Then
GUICtrlSetState ($allTestsCB, $GUI_UNCHECKED )
GUICtrlSetState ($fileCB, $GUI_UNCHECKED )
GUICtrlSetState ($editCB, $GUI_UNCHECKED )
GUICtrlSetState ($viewCB, $GUI_UNCHECKED )
GUICtrlSetState ($favCB, $GUI_UNCHECKED )
GUICtrlSetState ($toolsCB, $GUI_UNCHECKED )
GUICtrlSetState ($helpCB, $GUI_UNCHECKED )
GUICtrlSetState ($printCB, $GUI_UNCHECKED )
GUICtrlSetState ($navCB, $GUI_UNCHECKED )
GUICtrlSetState ($plugCB, $GUI_UNCHECKED )
EndIf
;ExitLoop
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
WEnd

GUIDelete()

$ieWinStart = "about:blank - Windows Internet Explorer"
$iewin = "Windows Internet Explorer"
$ieFileOpen = "Open"

Global $Paused
HotKeySet("{F7}","Terminate")
HotKeySet("{F5}", "Pause")

SplashTextOn("Beginning IE9 Tests", "Attempting to load IE9", 300, 100, -1, 0, 4)

if not Run(@ProgramFilesDir & "Internet Explorer 9iexplore.exe about:blank") Then
SplashOff()
MsgBox(4096, "Error", "Path to IE9 not found. Make sure the IE9 Layer is Activated!")
Exit
EndIf

WinWaitActive ($iewin)
$ie9Handle = WinGetHandle($ieWinStart)
If @error Then
SplashOff()
;;MsgBox(4096, "Error", "Could not find the correct window")
EndIf

Opt("WinTitleMatchMode", 1)
SplashTextOn("Beginning IE8 Tests", "Setting IE8 for the Tests...", 300, 100, -1, 0, 4)
Sleep(2000)
NavigateUsingAddr("www.google.com","window")
WinWait("Google")

;~ Sleep(2000)
;~ Send("!t")
;~ Sleep(2000)
;~ Send("o")
;~ Sleep(2000)
;~ SplashTextOn("Beginning IE8 Tests", "Setting IE8 for the Tests...: Waiting Internet Options", 300, 100, -1, 0, 4)
;~ WinWait("Internet Options")
;~ SplashTextOn("Beginning IE8 Tests", "Setting IE8 for the Tests...: Found Internet Options", 300, 100, -1, 0, 4)
;~ Sleep(1000)
;~ Send("!c")
;~ Sleep(1000)
;~ Send("{TAB 15}")
;~ sleep(3000)
;~ Send("{ENTER}")
;~ Sleep(2000)
;~ Send("{TAB 15}")
;~ Sleep(3000)
;~ Send("{RIGHT 2}")
;~ sleep(1000)
;~ Send("{TAB 1}")
;~ sleep(1000)
;~ Send("{UP 3}")
;~ Sleep(1000)
;~ Send("{TAB 7}")
;~ Sleep(2000)
;~ Send("{ENTER}")
;~ Sleep(1000)
;~ WinWait("Pop-up Blocker Settings")
;~ Send("{TAB 6}")
;~ Sleep(3000)
;~ Send("{UP 2}")
;~ Sleep(1000)
;~ ControlCommand("Pop-up Blocker Settings", "Show Notification Bar when a pop-up is blocked.", 5417, "UnCheck")
;~ Sleep(2000)
;~ Send("{TAB 5}")
;~ Sleep(2000)
;~ Send("{ENTER}")
;~ Sleep(2000)
;~ Send("{DOWN 3}")
;~ Sleep(3000)
;~ Send("{ENTER}")

Sleep(7000)

Opt("WinTitleMatchMode", 2)
if $runFileTests Then
SplashTextOn("Running File Menu Tests", "File Menu Tests", 300, 100, -1, 0, 4)
FileMenuTests($ie9handle)
SplashOff()
EndIf

if $runEditTests Then
SplashTextOn("Running Edit Menu Tests", "Edit Menu Tests", 300, 100, -1, 0, 4)
Sleep(3000)
EditMenuTests($ie9handle)
SplashOff()
EndIf

if $runViewTests Then
SplashTextOn("Running View Menu Tests", "View Menu Tests", 300, 100, -1, 0, 4)
ViewMenuTests($ie9handle)
SplashOff()
EndIf

if $runFavTests Then
SplashTextOn("Running Favorites Menu Tests", "Favorites Menu Tests", 300, 100, -1, 0, 4)
FavoritesMenuTests($ie9handle)
SplashOff()
EndIf

if $runToolTests Then
SplashTextOn("Running Tools Menu Tests", "File Tools Tests", 300, 100, -1, 0, 4)
ToolsMenuTests($ie9handle)
SplashOff()
EndIf

if $runHelpTests Then
SplashTextOn("Running Help Menu Tests", "Help Menu Tests", 300, 100, -1, 0, 4)
HelpMenuTests($ie9handle)
SplashOff()
EndIf

if $runPrntTests Then
SplashTextOn("Running IE9 Printing Tests", "Running IE9 Print Function Tests", 300, 100, -1, 0, 4)
Sleep(1000)
;Navigate to a site so there is something to print
NavigateUsingAddr("www.google.com", $ie9handle)
Sleep(5000) ; give some time for the site to load.
PrintingTest($ie9handle)
Sleep(5000)
SplashOff()
EndIf

if $runNavTests Then
SplashTextOn("Running IE9 Navigation Tests", "Running IE9 Navigation Tests", 300, 100, -1, 0, 4)
NavigationTests($ie9handle)
Sleep(5000)
SplashOff()
EndIf

if $runPlugTests Then
SplashTextOn("Running IE9 Plugin Tests", "Running IE9 Plugin Tests", 300, 100, -1, 0, 4)
PluginTests($ie9handle)
Sleep(5000)
SplashOff()
EndIf

SplashTextOn("Running IE9 Tests", "Selected Tests are Completed!", 300, 100, -1, 0, 4)
Sleep(6000)
SplashOff()

WinClose($ie9handle)
;DONE



Func NavigateUsingOpen($url)
Send("^o")
WinWait($ieFileOpen)
Sleep(1000)
Send($url, 1)
Sleep(1000)
Send("{ENTER}")
;Sleep(1000)
;ControlClick($ieFileOpen, "", 1)
EndFunc

Func NavigateUsingAddr($url, $window)
ControlFocus($window, "", "[CLASS:ComboBox; INSTANCE:1]")
Sleep(1000)
Send("!d")
Sleep(1000)
Send($url, 1)
Sleep(1000)
Send("{ENTER}")
EndFunc



Func FileMenuTests($window)
;~ Local $oIE = _IE_Example("basic")
Global $IELanguage = _IEPropertyGet( $ie9handle, "browserlanguage")
;~ ConsoleWrite("Language: " & $IELanguage)
Select
Case not StringInStr ( $IELanguage, "en-us") = 0
If @OSArch = "X86" Then
if @OSVersion = "WIN_7" Then
FileMenuTestsx32($window)
EndIf
ElseIf @OSArch = "X64" Then
if @OSversion = "WIN_7" Then
FileMenuTestsx64($window)
EndIf
EndIf
Case Not StringInStr ( $IELanguage, "") = 0
EndSelect
EndFunc
Link to comment
Share on other sites

When i try to simplify the code, i still get the same error message.

#Include 
#include 
#include 
#Include 
#include 
#include 

$ieWinStart = "about:blank - Windows Internet Explorer"
$iewin = "Windows Internet Explorer"
$ieFileOpen = "Open"

Global $Paused
HotKeySet("{F7}","Terminate")
HotKeySet("{F5}", "Pause")


if not Run(@ProgramFilesDir & "Internet Explorer 9iexplore.exe about:blank") Then
SplashOff()
MsgBox(4096, "Error", "Path to IE9 not found. Make sure the IE9 Layer is Activated!")
Exit
EndIf

WinWaitActive ($iewin)
$ie9Handle = WinGetHandle($ieWinStart)




;~ Local $oIE = _IE_Example("basic")
Global $IELanguage = _IEPropertyGet( $ie9handle, "browserlanguage")
ConsoleWrite("Language: " & $IELanguage)
Select
Case not StringInStr ( $IELanguage, "en-us") = 0
If @OSArch = "X86" Then
if @OSVersion = "WIN_7" Then
FileMenuTestsx32($window)
EndIf
ElseIf @OSArch = "X64" Then
if @OSversion = "WIN_7" Then
FileMenuTestsx64($window)
EndIf
EndIf
Case Not StringInStr ( $IELanguage, "") = 0
EndSelect

>"C:Program FilesAutoIt3SciTE..autoit3.exe" /ErrorStdOut "C:UsersAdminDesktopAutoIt22222Archivos au3ie9-ui-WIN_7.au3"

--> IE.au3 V2.4-0 Error from function _IEPropertyGet, $_IEStatus_InvalidDataType

Language: 0>Exit code: 0 Time: 1.032

Link to comment
Share on other sites

Try this, I had to comment out most of your function calls because those functions don't exist in the script you posted.

; *** Start added by AutoIt3Wrapper ***
#include <GUIConstantsEx.au3>
; *** End added by AutoIt3Wrapper ***
#AutoIt3Wrapper_Add_Constants=n
#include <IE.au3>
Opt("WinTitleMatchMode", 2)
Dim $runAllTests = False, $runFileTests = False, $runViewTests = False, $runEditTests = False, $runFavTests = False, $runToolTests = False, $runHelpTests = False, $runPrntTests = False, $runNavTests = False, $runPlugTests = False
GUICreate("IE9 Automated Testing", 320, 300)
GUICtrlCreateLabel("This Autoit Script automates the testing of nearly all UI components, Navigation and Plugins (Adobe Flash, Adobe Reader and Java).", 10, 10, 300, 50)
$allTestsCB = GUICtrlCreateCheckbox("Run All Tests", 10, 60, 200)
$fileCB = GUICtrlCreateCheckbox("File Menu Tests", 10, 80, 200)
$editCB = GUICtrlCreateCheckbox("Edit Menu Tests", 10, 100, 200)
$viewCB = GUICtrlCreateCheckbox("View Menu Tests", 10, 120, 200)
$favCB = GUICtrlCreateCheckbox("Favorites Menu Tests", 10, 140, 200)
$toolsCB = GUICtrlCreateCheckbox("Tools Menu Tests", 10, 160, 200)
$helpCB = GUICtrlCreateCheckbox("Help Menu Tests", 10, 180, 200)
$printCB = GUICtrlCreateCheckbox("Printing Menu Tests", 10, 200, 200)
$navCB = GUICtrlCreateCheckbox("Navigation Test", 10, 220, 200)
$plugCB = GUICtrlCreateCheckbox("Plugins Test", 10, 240, 200)
$okbutton = GUICtrlCreateButton("OK", 180, 260, 60)
$cancelbutton = GUICtrlCreateButton("Cancel", 245, 260, 60)
GUISetState(@SW_SHOW)
GUICtrlSetState($allTestsCB, $GUI_CHECKED)
GUICtrlSetState($fileCB, $GUI_CHECKED)
GUICtrlSetState($editCB, $GUI_CHECKED)
GUICtrlSetState($viewCB, $GUI_CHECKED)
GUICtrlSetState($favCB, $GUI_CHECKED)
GUICtrlSetState($toolsCB, $GUI_CHECKED)
GUICtrlSetState($helpCB, $GUI_CHECKED)
GUICtrlSetState($printCB, $GUI_CHECKED)
GUICtrlSetState($navCB, $GUI_CHECKED)
GUICtrlSetState($plugCB, $GUI_CHECKED)
While 1
     $msg = GUIGetMsg()
     Select
          Case $msg = $cancelbutton
               Exit
          Case $msg = $okbutton
               $uiCtrlState = GUICtrlRead($fileCB, 0)
               If $uiCtrlState = $GUI_CHECKED Then
                    $runFileTests = True
               Else
                    $runFileTests = False
               EndIf
               $uiCtrlState = GUICtrlRead($editCB, 0)
               If $uiCtrlState = $GUI_CHECKED Then
                    $runEditTests = True
               Else
                    $runEditTests = False
               EndIf
               $uiCtrlState = GUICtrlRead($viewCB, 0)
               If $uiCtrlState = $GUI_CHECKED Then
                    $runViewTests = True
               Else
                    $runViewTests = False
               EndIf
               $uiCtrlState = GUICtrlRead($favCB, 0)
               If $uiCtrlState = $GUI_CHECKED Then
                    $runFavTests = True
               Else
                    $runFavTests = False
               EndIf
               $uiCtrlState = GUICtrlRead($toolsCB, 0)
               If $uiCtrlState = $GUI_CHECKED Then
                    $runToolTests = True
               Else
                    $runToolTests = False
               EndIf
               $uiCtrlState = GUICtrlRead($helpCB, 0)
               If $uiCtrlState = $GUI_CHECKED Then
                    $runHelpTests = True
               Else
                    $runHelpTests = False
               EndIf
               $uiCtrlState = GUICtrlRead($printCB, 0)
               If $uiCtrlState = $GUI_CHECKED Then
                    $runPrntTests = True
               Else
                    $runPrntTests = False
               EndIf
               $uiCtrlState = GUICtrlRead($navCB, 0)
               If $uiCtrlState = $GUI_CHECKED Then
                    $runNavTests = True
               Else
                    $runNavTests = False
               EndIf
               $uiCtrlState = GUICtrlRead($plugCB, 0)
               If $uiCtrlState = $GUI_CHECKED Then
                    $runPlugTests = True
               Else
                    $runPlugTests = False
               EndIf
               GUIDelete()
               ExitLoop
          Case $msg = $allTestsCB
               $ctrlState = GUICtrlRead($allTestsCB, 0)
               If $ctrlState = $GUI_CHECKED Then
                    GUICtrlSetState($allTestsCB, $GUI_CHECKED)
                    GUICtrlSetState($fileCB, $GUI_CHECKED)
                    GUICtrlSetState($editCB, $GUI_CHECKED)
                    GUICtrlSetState($viewCB, $GUI_CHECKED)
                    GUICtrlSetState($favCB, $GUI_CHECKED)
                    GUICtrlSetState($toolsCB, $GUI_CHECKED)
                    GUICtrlSetState($helpCB, $GUI_CHECKED)
                    GUICtrlSetState($printCB, $GUI_CHECKED)
                    GUICtrlSetState($navCB, $GUI_CHECKED)
                    GUICtrlSetState($plugCB, $GUI_CHECKED)
               ElseIf $ctrlState = $GUI_UNCHECKED Then
                    GUICtrlSetState($allTestsCB, $GUI_UNCHECKED)
                    GUICtrlSetState($fileCB, $GUI_UNCHECKED)
                    GUICtrlSetState($editCB, $GUI_UNCHECKED)
                    GUICtrlSetState($viewCB, $GUI_UNCHECKED)
                    GUICtrlSetState($favCB, $GUI_UNCHECKED)
                    GUICtrlSetState($toolsCB, $GUI_UNCHECKED)
                    GUICtrlSetState($helpCB, $GUI_UNCHECKED)
                    GUICtrlSetState($printCB, $GUI_UNCHECKED)
                    GUICtrlSetState($navCB, $GUI_UNCHECKED)
                    GUICtrlSetState($plugCB, $GUI_UNCHECKED)
               EndIf
               ;ExitLoop
          Case $msg = $GUI_EVENT_CLOSE
               Exit
     EndSelect
WEnd
GUIDelete()
$ieWinStart = "Blank Page"
$iewin = "Windows Internet Explorer"
$ieFileOpen = "Open"
Global $Paused
;~ HotKeySet("{F7}", "Terminate")
;~ HotKeySet("{F5}", "Pause")
SplashTextOn("Beginning IE9 Tests", "Attempting to load IE9", 300, 100, -1, 0, 4)
Global $objIE = _IECreate("about:blank")
WinWaitActive($iewin)
$ie9Handle = WinGetHandle($ieWinStart)
If @error Then
     SplashOff()
     ;;MsgBox(4096, "Error", "Could not find the correct window")
EndIf
SplashTextOn("Beginning IE8 Tests", "Setting IE8 for the Tests...", 300, 100, -1, 0, 4)
Sleep(2000)
NavigateUsingAddr("[url="http://www.google.com"]www.google.com[/url]", "window")
WinWait("Google")
;~ Sleep(2000)
;~ Send("!t")
;~ Sleep(2000)
;~ Send("o")
;~ Sleep(2000)
;~ SplashTextOn("Beginning IE8 Tests", "Setting IE8 for the Tests...: Waiting Internet Options", 300, 100, -1, 0, 4)
;~ WinWait("Internet Options")
;~ SplashTextOn("Beginning IE8 Tests", "Setting IE8 for the Tests...: Found Internet Options", 300, 100, -1, 0, 4)
;~ Sleep(1000)
;~ Send("!c")
;~ Sleep(1000)
;~ Send("{TAB 15}")
;~ sleep(3000)
;~ Send("{ENTER}")
;~ Sleep(2000)
;~ Send("{TAB 15}")
;~ Sleep(3000)
;~ Send("{RIGHT 2}")
;~ sleep(1000)
;~ Send("{TAB 1}")
;~ sleep(1000)
;~ Send("{UP 3}")
;~ Sleep(1000)
;~ Send("{TAB 7}")
;~ Sleep(2000)
;~ Send("{ENTER}")
;~ Sleep(1000)
;~ WinWait("Pop-up Blocker Settings")
;~ Send("{TAB 6}")
;~ Sleep(3000)
;~ Send("{UP 2}")
;~ Sleep(1000)
;~ ControlCommand("Pop-up Blocker Settings", "Show Notification Bar when a pop-up is blocked.", 5417, "UnCheck")
;~ Sleep(2000)
;~ Send("{TAB 5}")
;~ Sleep(2000)
;~ Send("{ENTER}")
;~ Sleep(2000)
;~ Send("{DOWN 3}")
;~ Sleep(3000)
;~ Send("{ENTER}")
Sleep(7000)
Opt("WinTitleMatchMode", 2)
If $runFileTests Then
     SplashTextOn("Running File Menu Tests", "File Menu Tests", 300, 100, -1, 0, 4)
     FileMenuTests($ie9Handle)
     SplashOff()
EndIf
If $runEditTests Then
     SplashTextOn("Running Edit Menu Tests", "Edit Menu Tests", 300, 100, -1, 0, 4)
     Sleep(3000)
;~    EditMenuTests($ie9Handle)
     SplashOff()
EndIf
If $runViewTests Then
     SplashTextOn("Running View Menu Tests", "View Menu Tests", 300, 100, -1, 0, 4)
;~    ViewMenuTests($ie9Handle)
     SplashOff()
EndIf
If $runFavTests Then
     SplashTextOn("Running Favorites Menu Tests", "Favorites Menu Tests", 300, 100, -1, 0, 4)
;~    FavoritesMenuTests($ie9Handle)
     SplashOff()
EndIf
If $runToolTests Then
     SplashTextOn("Running Tools Menu Tests", "File Tools Tests", 300, 100, -1, 0, 4)
;~    ToolsMenuTests($ie9Handle)
     SplashOff()
EndIf
If $runHelpTests Then
     SplashTextOn("Running Help Menu Tests", "Help Menu Tests", 300, 100, -1, 0, 4)
;~    HelpMenuTests($ie9Handle)
     SplashOff()
EndIf
If $runPrntTests Then
     SplashTextOn("Running IE9 Printing Tests", "Running IE9 Print Function Tests", 300, 100, -1, 0, 4)
     Sleep(1000)
     ;Navigate to a site so there is something to print
     NavigateUsingAddr("[url="http://www.google.com"]www.google.com[/url]", $ie9Handle)
     Sleep(5000) ; give some time for the site to load.
;~    PrintingTest($ie9Handle)
     Sleep(5000)
     SplashOff()
EndIf
If $runNavTests Then
     SplashTextOn("Running IE9 Navigation Tests", "Running IE9 Navigation Tests", 300, 100, -1, 0, 4)
;~    NavigationTests($ie9Handle)
     Sleep(5000)
     SplashOff()
EndIf
If $runPlugTests Then
     SplashTextOn("Running IE9 Plugin Tests", "Running IE9 Plugin Tests", 300, 100, -1, 0, 4)
;~    PluginTests($ie9Handle)
     Sleep(5000)
     SplashOff()
EndIf
SplashTextOn("Running IE9 Tests", "Selected Tests are Completed!", 300, 100, -1, 0, 4)
Sleep(6000)
SplashOff()
WinClose($ie9Handle)
Func FileMenuTests($window)
;~ Local $oIE = _IE_Example("basic")
     Global $IELanguage = _IEPropertyGet($objIE, "browserlanguage")
     ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $IELanguage = ' & $IELanguage & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
;~ ConsoleWrite("Language: " & $IELanguage)
     Select
          Case Not StringInStr($IELanguage, "en-us") = 0
               If @OSArch = "X86" Then
                    If @OSVersion = "WIN_7" Then
;~                        FileMenuTestsx32($window)
                    EndIf
               ElseIf @OSArch = "X64" Then
                    If @OSVersion = "WIN_7" Then
;~                        FileMenuTestsx64($window)
                    EndIf
               EndIf
          Case Not StringInStr($IELanguage, "") = 0
     EndSelect
EndFunc   ;==>FileMenuTests
Func NavigateUsingAddr($url, $window)
     ControlFocus($window, "", "[CLASS:ComboBox; INSTANCE:1]")
     Sleep(1000)
     Send("!d")
     Sleep(1000)
     Send($url, 1)
     Sleep(1000)
     Send("{ENTER}")
EndFunc   ;==>NavigateUsingAddr
;DONE
Func NavigateUsingOpen($url)
     Send("^o")
     WinWait($ieFileOpen)
     Sleep(1000)
     Send($url, 1)
     Sleep(1000)
     Send("{ENTER}")
     ;Sleep(1000)
     ;ControlClick($ieFileOpen, "", 1)
EndFunc   ;==>NavigateUsingOpen

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

so $ie9hanhle main contain a function that doesnt work with the _IEPropertyGet right ? i need to modify $ie9handle to fit the required parameters of _IEPropertyGet. ?

$ieWinStart = "about:blank - Windows Internet Explorer"

$ie9Handle = WinGetHandle($ieWinStart)

knowing this... the problem is that i wont be able to set this as an $o_object Object variable of an InternetExplorer.Application or DOM element

am i right ?

im trying to understand this befor trying to rewrite the code.

Link to comment
Share on other sites

Look up, I rewrote it so that it works. Instead of running Internet Explorer, I used the _IECreate function to start the browser and created the correct browser object ($objIE) that _IEPropertyGet needs. The rest of your script shouldn't be affected because I got the Window handle just after creating the browser window, and it's still put into the variable $ie9handle.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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