Hey I am new to wd and I have the problem with changing an inout value.
The Website does automatically preset a value. So if I use:
_WD_ElementAction($sSession, $Systeminput, 'value', $i )
it just adds $i behind the existing value instead of replaxing it. So what I have tried is to use Send("Backspace") to delet text but it doesnt work so i tried it with
_WD_ElementAction($sSession, $sElement, 'value', "\uE003")
but here it just added "\uE003" as text into the next input the is right placed of the input i want to change .
So This is what i have (shorten):
#include "wd_core.au3"
#include "wd_helper.au3"
Local $sDesiredCapabilities, $sSession
SetupChrome()
_WD_Startup()
$sSession = _WD_CreateSession($sDesiredCapabilities)
_WD_Navigate($sSession, "Website...")
$logfile = ".\Logger.log"
$logiconent = FileReadLine($logfile, 1)
$i = $logiconent;zuletztgewesene StandardSystem
HotKeySet("{NumPad2}", "DoSth")
While 1
Sleep(50)
WEnd
Func DoSth()
$Systeminput = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='input-id']")
_WD_ElementAction($sSession, $Systeminput, 'value', $i )
sleep(100)
_WD_ExecuteScript($sSession, "jQuery('#confirmbutton').click()")
EndFunc
_WD_Shutdown()
Func SetupChrome()
_WD_Option('Driver', 'chromedriver.exe')
_WD_Option('Port', 9515)
_WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"')
$sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"]}}}}'
EndFunc ;==>SetupChrome
Func SetupGecko()
_WD_Option('Driver', 'geckodriver.exe')
_WD_Option('DriverParams', '--log trace')
_WD_Option('Port', 4444)
$sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}'
EndFunc ;==>SetupGecko
I hope you can help me out
again summary: How to replace input value