You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
video-uploader/Tools/TestSeleniumInstall.ahk

58 lines
2.5 KiB
Plaintext

2 years ago
;---ENVIRONMENT---------------------------------------------------------------------
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
;#Warn ; Enable warnings to assist with detecting common errors.
;DetectHiddenWindows, On
#SingleInstance, Force
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;SetKeyDelay, 500
CoordMode, ToolTip, Screen
CoordMode, Mouse, Screen
;#NoTrayIcon
;Menu, Tray, Icon, ..\Icons\ICONNAMEHERE
;---Notes/Extra Info/#Includes------------------------------------------------------
#include %A_ScriptDir%/Lib/Schrome.ahk ; used for chrome debugging mode connection
;---VARIABLES-----------------------------------------------------------------------
IniRead, ChromeProfile, Settings.ini, General, ChromeProfile
;---MAIN SCRIPT---------------------------------------------------------------------
driver:= ComObjCreate("Selenium.CHROMEDriver") ;Select and Create Chrome driver instance
driver.AddArgument("disable-infobars") ;Hides 'Chrome is being controlled by automated test software' message
driver.AddArgument("--start-maximized") ; Maximize Chrome Browser
driver.AddArgument("--disable-gpu")
;driver.AddArgument("--headless")
try driver.Get("https://duckduckgo.com/") ;Open selected URL
/*catch e {
Msgbox,4096,Error, Unable to connect to Chrome COM Object. `nMost likely issue is that .Net framework 3.5 is not installed.`nMake sure it is installed by navigating to Start > Turn Windows features on and Off > .NET Framekwork 3.5 > TRUE`n`nAnother possibility is that you don't have chromedriver.exe in: C:\Program Files\SeleniumBasic\chromedriver.exe
ExitApp
}
*/
try driver.executeScript("return document.readyState").equals("complete") ; wait until page loads completely before proceeding
msgbox,4096,Success,If you installed Selenium correctly, A chrome window should have opened up and navigated to duckdcukgo.com. `nClick OK to close and to do a chrome profile test
; Msgbox % "ChromeProfile: " ChromeProfile
Driver := SChrome_Get("https://www.bitchute.com/", ChromeProfile) ; open new tab page with with specified profile
Msgbox,4096,Success?, If everything worked correctly you should have received a prompt to reopen chrome in debugging mode and then opened up chrome with the profile you have set in settings.ini and opened up BitChute.com`n`nClick OK to exit this script
ExitApp
;---FUNCTIONS-----------------------------------------------------------------------