julianfazri Posted 3 hours ago Posted 3 hours ago Hi All, I am new with AutoIt. I want to create a simple script to open specific site on browser using web driver, but I got error line with "Error: Unknown function name" message, but I don't know which line from my au3. I put the code below, I hope you can help me tho solved this. expandcollapse popup; ONLY FOR DEMO USE ; Created to work with SPS 6.12 or later where multiple authentication backends are configured. ; ; Compile with Aut2exe to ensure the include files are added too ; cmd line arguments for launcher: OI-SG-RemoteApp-Launcher.exe --cmd <path>\web_SPS_local_user.exe --args "{username} {password} {asset}" Opt("TrayAutoPause", 0) Opt("TrayIconDebug", 0) ;#include <MsgBoxConstants.au3> #include 'webdriver\wd_core.au3' #include 'webdriver\wd_helper.au3' Local $asset = $CmdLine[1] ; Configure domain suffix for the asset the user is navigating to ;Local $domainSuffix = '.oneidentity.demo' Local $sDesiredCapabilities, $sSession ; We use Chrome in this script. For other browsers lookup the functions below. SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) ; Hide the WebDriver console _WD_ConsoleVisible(false) ; Navigate to asset website _WD_Navigate($sSession, 'https://' & $asset) Func SetupGecko() _WD_Option('Driver', 'webdriver\geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts":true}}}' EndFunc ;==>SetupGecko Func SetupChrome() _WD_Option('Driver', 'webdriver\chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') ; Add chromeOption to not offer saving credentials $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"], "prefs": { "credentials_enable_service": false, "profile": { "password_manager_enabled": false}}} }}}' EndFunc ;==>SetupChrome Func SetupEdge() _WD_Option('Driver', 'webdriver\msedgedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\msedge.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"excludeSwitches": [ "enable-automation"]}}}}' EndFunc ;==>SetupEdge Thanks. Regards, Julian
Developers Jos Posted 3 hours ago Developers Posted 3 hours ago Moved to the appropriate forum. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now