Das ist ohne dein Script zu kennen schwierig zu beantworten, da es verschiedene Ansätze gibt.
Schau dir einmal das "Getting started example" Script im Abschnitt "create capabilites for session" auf der folgenden Webseite an, da sollte das klar werden.
Ansonsten poste doch mal dein Script (ohne URL und Passwörter)
Hier mal ein Beispiel zum Login für Autoit, so wie ich das mache. Achtung hier wird noch die Chrome Version anhand der GoogleChrome.exe ausgelesen. Das müsstest du an deine Gegebenheiten anpassen.
AutoIt
#include "wd_helper.au3"
#include "wd_core.au3"
Local $file
$GoogleChrome64bit = "C:\Program Files\Google\Chrome\Application\chrome.exe"
$GoogleChrome32bit = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
If FileExists($GoogleChrome64bit) Then $file = $GoogleChrome64bit
If FileExists($GoogleChrome32bit) Then $file = $GoogleChrome32bit
If FileExists($file) Then
$google_chrome_version = FileGetVersion($file)
$google_chrome_version_array = StringSplit($google_chrome_version,".")
$webdriver = "chromedriver_" & $google_chrome_version_array[1] & ".exe"
If Not FileExists(@ScriptDir & '\data\'& $webdriver) Then
MsgBox(0,"Info","Google Chromedriver nicht vorhanden." & @CRLF & $webdriver)
Exit
EndIf
Else
MsgBox(0,"Info","Google Chrome in folgenden Pfad nicht vorhanden." & @CRLF & @CRLF & $file)
Exit
EndIf
$user = ""
$pass = ""
$_WD_DEBUG = $_WD_DEBUG_None ;set to $_WD_DEBUG_None before compiling.
;Global $_WD_DRIVER
Local $sDesiredCapabilities
Local $iIndex
$url = "https://autoit.de/wcf/login/?url=https%3A%2F%2Fautoit.de%2F"
SetupChrome()
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Window($sSession, "Maximize", "{}")
_WD_Navigate($sSession, $url)
_WD_LoadWait($sSession, 1500)
;WinSetState ("","",@SW_MAXIMIZE)
_WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id='username']")
;ConsoleWrite("+ @error = " & @error & @CRLF)
$sElement_user = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id='username']")
_WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id='password']")
;ConsoleWrite("+ @error = " & @error & @CRLF)
$sElement_pass = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id='password']")
If @error = $_WD_ERROR_Success Then
_WD_ElementAction($sSession, $sElement_user, 'value',$user)
EndIf
If @error = $_WD_ERROR_Success Then
_WD_ElementAction($sSession, $sElement_pass, 'value',$pass)
EndIf
Sleep(1000)
;Send("{ENTER}")
$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[1]/section/div/div/div[1]/form/section[1]/div/input[1]")
;_WD_HighlightElement($sSession, $sElement, 3)
If @error = $_WD_ERROR_Success Then
_WD_ElementAction($sSession, $sElement, 'click')
Sleep(500)
EndIf
_WD_Shutdown()
_WD_DeleteSession($sSession)
Exit
Func SetupChrome()
;_WD_Option('Driver', 'chromedriver.exe')
_WD_Option('Driver', 'data\'& $webdriver)
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--log-path="' & @UserProfileDir & '\chrome.log"')
_WD_Option('DriverParams')
$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"unhandledPromptBehavior": "ignore", ' & _
'"goog:chromeOptions": {"w3c": true, "excludeSwitches": ["enable-automation"], "useAutomationExtension": false, ' & _
'"prefs": {"credentials_enable_service": false},' & _
'"args": ["--disable-search-engine-choice-screen"] }}}}'
EndFunc
Alles anzeigen
Gruß gmmg