nooneclose Posted January 7, 2019 Share Posted January 7, 2019 @Danp2 I have extracted those au3 files, core, helper, and demo. now it gives me this error: "C:\Users\a\Desktop\Bots\MyBotScripts\testing_WebDiver.au3"(26,12) : error: _WDStartup(): undefined function. this is my code so far. I am just trying to test it to see if it works. ;#include "webdriver.au3" Cant find this file? #include "wd_core.au3" #include "wd_helper.au3" #include "wd_demo.au3" _WDStartup() Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2019 Author Share Posted January 7, 2019 All of the Webdriver UDF functions start with _WD_ (note the trailing underscore). vohuythu 1 WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
nooneclose Posted January 7, 2019 Share Posted January 7, 2019 @Danp2 Ok I changed it and this is what it gave me: Code: #include "wd_core.au3" #include "wd_helper.au3" #include "wd_demo.au3" _WD_Startup() Output: _WDStartup: OS: WIN_10 WIN32_NT 17134 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.1.0.16 _WDStartup: Driver: geckodriver.exe _WDStartup: Params: --log trace _WDStartup: Port: 4444 _WD_Startup ==> General Error: Error launching web driver! Then I tried the test code you posted a year ago and this is what that gave me: Code: expandcollapse popup#include "wd_core.au3" #include "wd_helper.au3" #include "wd_demo.au3" Local $aTestSuite[5][2] = [["TestTimeouts", True], ["TestNavigation", True], ["TestElements", True], ["TestScript", True], ["TestCookies", True]] Local $sDesiredCapabilities Local $iIndex Global $_WD__LOCATOR_ByXPath Global $_WD__ERROR_NoMatch $_WD__DEBUG = True Switch $_TestType Case $eFireFox SetupGecko() Case $eChrome SetupChrome() EndSwitch _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) $sStatus = _WD_Status() For $iIndex = 0 To UBound($aTestSuite, $UBOUND_ROWS) - 1 If $aTestSuite[$iIndex][1] Then ConsoleWrite("Running: " & $aTestSuite[$iIndex][0] & @CRLF) Call($aTestSuite[$iIndex][0]) Else ConsoleWrite("Bypass: " & $aTestSuite[$iIndex][0] & @CRLF) EndIf Next _WD_DeleteSession($sSession) _WD_Shutdown() Func TestTimeouts() _WD_Timeouts($sSession) _WD_Timeouts($sSession, '{"script":10000,"pageLoad":200000,"implicit":30}') _WD_Timeouts($sSession) EndFunc Func TestNavigation() _WD_Navigate($sSession, "http://google.com") ConsoleWrite("URL=" & _WD_Action($sSession, 'url') & @CRLF) _WD_Action($sSession, "back") ConsoleWrite("URL=" & _WD_Action($sSession, 'url') & @CRLF) _WD_Action($sSession, "forward") ConsoleWrite("URL=" & _WD_Action($sSession, 'url') & @CRLF) ConsoleWrite("Title=" & _WD_Action($sSession, 'title') & @CRLF) EndFunc ;_WD_Window($sSession, 'frame', '{"id":null}') Func TestElements() _WD_Navigate($sSession, "http://google.com") $sElement = _WD_FindElement($sSession, $_WD__LOCATOR_ByXPath, "//input[@id='lst-ib1']") If @error = $_WD__ERROR_NoMatch Then $sElement = _WD_FindElement($sSession, $_WD__LOCATOR_ByXPath, "//input[@id='lst-ib']") EndIf $sElement2 = _WD_FindElement($sSession, $_WD__LOCATOR_ByXPath, "//div/input", '', True) _WD_ElementAction($sSession, $sElement, 'value', "testing 123") _WD_ElementAction($sSession, $sElement, 'text') _WD_ElementAction($sSession, $sElement, 'clear') _WD_ElementAction($sSession, $sElement, 'value', "abc xyz") _WD_ElementAction($sSession, $sElement, 'text') _WD_ElementAction($sSession, $sElement, 'clear') _WD_ElementAction($sSession, $sElement, 'value', "fujimo") _WD_ElementAction($sSession, $sElement, 'text') _WD_ElementAction($sSession, $sElement, 'click') _WD_ElementAction($sSession, $sElement, 'Attribute', 'test') $sElement = _WD_FindElement($sSession, $_WD__LOCATOR_ByXPath, "//input[@id='lst-ib']") $sValue = _WD_ElementAction($sSession, $sElement, 'property', 'value') ConsoleWrite('value = ' & $sValue & @CRLF) EndFunc Func TestScript() _WD_ExecuteScript($sSession, 'alert()', "") _WD_Alert($sSession, 'Dismiss') EndFunc Func TestCookies() _WD_Navigate($sSession, "http://google.com") _WD_Cookies($sSession, 'Get', 'NID') EndFunc Output: _WDStartup: OS: WIN_10 WIN32_NT 17134 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.1.0.16 _WDStartup: Driver: geckodriver.exe _WDStartup: Params: --log trace _WDStartup: Port: 4444 _WD_Startup ==> General Error: Error launching web driver! Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2019 Author Share Posted January 7, 2019 It can't find the designated web driver. Where did you place geckodriver.exe? You'll need to add the path to this line of it's not in your current directory -- _WD_Option('Driver', 'geckodriver.exe') WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
nooneclose Posted January 7, 2019 Share Posted January 7, 2019 I have the geckodiver.exe in the include folder. is that not where it goes? Also what line should I add this to? _WD_Option('Driver', 'geckodriver.exe') Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2019 Author Share Posted January 7, 2019 That line is already in the wd_demo script. You need to adjust that line to include the path to the geckodriver, like this -- _WD_Option('Driver', 'c:\some\long\path\name\geckodriver.exe') WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
nooneclose Posted January 7, 2019 Share Posted January 7, 2019 (edited) @Danp2 Ok so i added the path and this is the new output: _WDStartup: OS: WIN_10 WIN32_NT 17134 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.1.0.16 _WDStartup: Driver: C:\Users\a\Desktop\General help\AutoIt_Stuff\AU3 include files\geckodriver.exe _WDStartup: Params: --log trace _WDStartup: Port: 4444 __WD_Post: URL=HTTP://127.0.0.1:4444/session; $sData={"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}} __WD_Post: StatusCode=500; ResponseText={"value":{"error":"session not created","message":"Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line","stacktrace":""}} _WD_CreateSession: {"value":{"error":"session not created","message":"Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line","stacktrace":""}} _WD_CreateSession ==> Webdriver Exception: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line __WD_Delete: URL=HTTP://127.0.0.1:4444/session/ __WD_Delete: StatusCode=404; ResponseText={"value":{"error":"unknown command","message":"DELETE /session/ did not match a known command","stacktrace":""}} _WD_DeleteSession: {"value":{"error":"unknown command","message":"DELETE /session/ did not match a known command","stacktrace":""}} Code: I ran the demo code expandcollapse popup#include "wd_core.au3" #include "wd_helper.au3" Local Enum $eFireFox = 0, _ $eChrome, _ $eEdge Local $aDemoSuite[][2] = [["DemoTimeouts", False], _ ["DemoNavigation", False], _ ["DemoElements", True], _ ["DemoScript", False], _ ["DemoCookies", False], _ ["DemoAlerts", False], _ ["DemoFrames", False], _ ["DemoActions", False], _ ["DemoWindows", False]] Local Const $_TestType = $eFireFox Local Const $sElementSelector = "//input[@name='q']" Local $sDesiredCapabilities Local $iIndex Local $sSession $_WD_DEBUG = $_WD_DEBUG_Info Switch $_TestType Case $eFireFox SetupGecko() Case $eChrome SetupChrome() Case $eEdge SetupEdge() EndSwitch _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit -1 EndIf $sSession = _WD_CreateSession($sDesiredCapabilities) If @error = $_WD_ERROR_Success Then For $iIndex = 0 To UBound($aDemoSuite, $UBOUND_ROWS) - 1 If $aDemoSuite[$iIndex][1] Then ConsoleWrite("Running: " & $aDemoSuite[$iIndex][0] & @CRLF) Call($aDemoSuite[$iIndex][0]) Else ConsoleWrite("Bypass: " & $aDemoSuite[$iIndex][0] & @CRLF) EndIf Next EndIf _WD_DeleteSession($sSession) _WD_Shutdown() Func DemoTimeouts() _WD_Timeouts($sSession) _WD_Timeouts($sSession, '{"pageLoad":2000}') _WD_Timeouts($sSession) EndFunc Func DemoNavigation() _WD_Navigate($sSession, "http://google.com") _WD_NewTab($sSession) _WD_Navigate($sSession, "http://yahoo.com") _WD_NewTab($sSession) _WD_Navigate($sSession, "http://bing.com") ConsoleWrite("URL=" & _WD_Action($sSession, 'url') & @CRLF) _WD_Attach($sSession, "google.com", "URL") ConsoleWrite("URL=" & _WD_Action($sSession, 'url') & @CRLF) _WD_Attach($sSession, "yahoo.com", "URL") ConsoleWrite("URL=" & _WD_Action($sSession, 'url') & @CRLF) EndFunc Func DemoElements() Local $sElement, $aElements, $sValue _WD_Navigate($sSession, "http://google.com") $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='q1']") If @error = $_WD_ERROR_NoMatch Then $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sElementSelector) EndIf $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div/input", '', True) _ArrayDisplay($aElements) _WD_ElementAction($sSession, $sElement, 'value', "testing 123") Sleep(500) _WD_ElementAction($sSession, $sElement, 'text') _WD_ElementAction($sSession, $sElement, 'clear') Sleep(500) _WD_ElementAction($sSession, $sElement, 'value', "abc xyz") Sleep(500) _WD_ElementAction($sSession, $sElement, 'text') _WD_ElementAction($sSession, $sElement, 'clear') Sleep(500) _WD_ElementAction($sSession, $sElement, 'value', "fujimo") Sleep(500) _WD_ElementAction($sSession, $sElement, 'text') _WD_ElementAction($sSession, $sElement, 'click') $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='btnK']") ConsoleWrite("Button Ref: " & $sButton & @CRLF) ConsoleWrite("Before Click" & @CRLF) _WD_ElementAction($sSession, $sButton, 'click') ;< Sleep(2000) ConsoleWrite("After Click" & @CRLF) _WD_ElementAction($sSession, $sElement, 'Attribute', 'text') $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sElementSelector) $sValue = _WD_ElementAction($sSession, $sElement, 'property', 'value') ConsoleWrite('value = ' & $sValue & @CRLF) EndFunc Func DemoScript() _WD_ExecuteScript($sSession, "return arguments[0].second;", '{"first": "1st", "second": "2nd", "third": "3rd"}') _WD_Alert($sSession, 'Dismiss') EndFunc Func DemoCookies() _WD_Navigate($sSession, "http://google.com") _WD_Cookies($sSession, 'Get', 'NID') Local $sName = "Testname" Local $sValue ="TestValue" Local $sCookie = '{"cookie": {"name":"' & $sName & '","value":"' & $sValue & '"}}' _WD_Cookies($sSession, 'add', $sCookie) _WD_Cookies($sSession, 'Get', $sName) EndFunc Func DemoAlerts() ConsoleWrite('Alert Detected => ' & _WD_Alert($sSession, 'status') & @CRLF) _WD_ExecuteScript($sSession, "alert('testing 123')") ConsoleWrite('Alert Detected => ' & _WD_Alert($sSession, 'status') & @CRLF) ConsoleWrite('Text Detected => ' & _WD_Alert($sSession, 'gettext') & @CRLF) _WD_Alert($sSession, 'sendtext', 'new text') ConsoleWrite('Text Detected => ' & _WD_Alert($sSession, 'gettext') & @CRLF) Sleep(5000) _WD_Alert($sSession, 'Dismiss') EndFunc Func DemoFrames() _WD_Navigate($sSession, "https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_frame_cols") ConsoleWrite("Frames=" & _WD_GetFrameCount($sSession) & @CRLF) ConsoleWrite("TopWindow=" & _WD_IsWindowTop($sSession) & @CRLF) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//iframe[@id='iframeResult']") _WD_FrameEnter($sSession, $sElement) ConsoleWrite("TopWindow=" & _WD_IsWindowTop($sSession) & @CRLF) _WD_FrameLeave($sSession) ConsoleWrite("TopWindow=" & _WD_IsWindowTop($sSession) & @CRLF) EndFunc Func DemoActions() Local $sElement, $aElements, $sValue _WD_Navigate($sSession, "http://google.com") $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sElementSelector) ConsoleWrite("$sElement = " & $sElement & @CRLF) $sAction = '{"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"' $sAction &= $sElement & '","' & $_WD_ELEMENT_ID & '":"' & $sElement & '"}},{"button":2,"type":"pointerDown"},{"button":2,"type":"pointerUp"}]}]}' ConsoleWrite("$sAction = " & $sAction & @CRLF) _WD_Action($sSession, "actions", $sAction) sleep(5000) _WD_Action($sSession, "actions") sleep(5000) EndFunc Func DemoWindows() Local $sResponse, $sResult, $sJSON, $sImage _WD_Navigate($sSession, "http://google.com") $sResponse = _WD_Window($sSession, 'screenshot') $sJSON = Json_Decode($sResponse) $sResult = Json_Get($sJSON, "[value]") $sImage = BinaryToString(base64($sResult, False)) ConsoleWrite($sImage & @CRLF) EndFunc Func SetupGecko() _WD_Option('Driver', 'C:\Users\a\Desktop\General help\AutoIt_Stuff\AU3 include files\geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true}}' EndFunc Func SetupChrome() _WD_Option('Driver', 'C:\Users\a\Desktop\General help\AutoIt_Stuff\AU3 include files\chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' EndFunc Func SetupEdge() _WD_Option('Driver', 'MicrosoftWebDriver.exe') _WD_Option('Port', 17556) _WD_Option('DriverParams', '--verbose') $sDesiredCapabilities = '{"capabilities":{}}' EndFunc ;============================================================================================================================== ; Function: base64($vCode [, $bEncode = True [, $bUrl = False]]) ; ; Description: Decode or Encode $vData using Microsoft.XMLDOM to Base64Binary or Base64Url. ; IMPORTANT! Encoded base64url is without @LF after 72 lines. Some websites may require this. ; ; Parameter(s): $vData - string or integer | Data to encode or decode. ; $bEncode - boolean | True - encode, False - decode. ; $bUrl - boolean | True - output is will decoded or encoded using base64url shema. ; ; Return Value(s): On Success - Returns output data ; On Failure - Returns 1 - Failed to create object. ; ; Author (s): (Ghads on Wordpress.com), Ascer ;=============================================================================================================================== Func base64($vCode, $bEncode = True, $bUrl = False) Local $oDM = ObjCreate("Microsoft.XMLDOM") If Not IsObj($oDM) Then Return SetError(1, 0, 1) Local $oEL = $oDM.createElement("Tmp") $oEL.DataType = "bin.base64" If $bEncode then $oEL.NodeTypedValue = Binary($vCode) If Not $bUrl Then Return $oEL.Text Return StringReplace(StringReplace(StringReplace($oEL.Text, "+", "-"),"/", "_"), @LF, "") Else If $bUrl Then $vCode = StringReplace(StringReplace($vCode, "-", "+"), "_", "/") $oEL.Text = $vCode Return $oEL.NodeTypedValue EndIf EndFunc ;==>base64 Edited January 7, 2019 by nooneclose Link to comment Share on other sites More sharing options...
Danp2 Posted January 7, 2019 Author Share Posted January 7, 2019 7 minutes ago, nooneclose said: __WD_Post: StatusCode=500; ResponseText={"value":{"error":"session not created","message":"Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line","stacktrace":""}} It can't find FireFox. If you've installed it to a non-default location, then it is your responsibility to provide it with the correct path. I believe there is an example of this in either this thread or the one for Webdriver support. WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
nooneclose Posted January 7, 2019 Share Posted January 7, 2019 @Danp2 I installed the latest version of Firefox and let it install in its default location and the demo script worked perfectly. Thank you very much for all your help! Link to comment Share on other sites More sharing options...
chadkin2019 Posted January 8, 2019 Share Posted January 8, 2019 How can i get the session id from an existing session? Because i want to control the existing session by another script file. Link to comment Share on other sites More sharing options...
Danp2 Posted January 8, 2019 Author Share Posted January 8, 2019 @chadkin2019 AFAIK, the W3C specs don't provide for a way to retrieve the session id from an existing instance of the webdriver. You could pass the session id from one script to another. WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
chadkin2019 Posted January 8, 2019 Share Posted January 8, 2019 I want to create a session (chrome website) which playing a video. After that i have another script that run regularly in the background to do somethings on an existing session (such as volume adjustment..) For some reasons i cant re-open the website every time i want to adjust the volume so that i have to separate into 2 scripts. My solution is to write the session id to a text file and read it every time i want to control this session. Are there any better solutions to handle this problem? Many thanks. Link to comment Share on other sites More sharing options...
Danp2 Posted January 8, 2019 Author Share Posted January 8, 2019 55 minutes ago, chadkin2019 said: My solution is to write the session id to a text file and read it every time i want to control this session. That's one solution. Other options would be -- Passing the session id as a parameter to the 2nd script Use IPC to pass the session id between scripts Combine everything into a single script that remains running in the background Heronmb 1 WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
chadkin2019 Posted January 9, 2019 Share Posted January 9, 2019 thanks again. I will try it out. Link to comment Share on other sites More sharing options...
danylarson Posted January 9, 2019 Share Posted January 9, 2019 Hi Dan, I asked some question for tables and you asked me for some example 1) I wanted to highlight a table and it does not seem to works properly in my examples 2) i coded the function _WD_GetTableContent($sSession, $aElements, $Separator) I think you can add this fonction to your library (and if you want improve it, you ll welcome ) Thanks for your help and answer Test.html GetTable.au3 Link to comment Share on other sites More sharing options...
Danp2 Posted January 9, 2019 Author Share Posted January 9, 2019 @danylarson Thanks for your submission. I'll get back to you once I've had some time to review your code. WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
fagh81 Posted January 11, 2019 Share Posted January 11, 2019 (edited) Hi, Can anyone help me. in html page i have two html code <button class="applyBtn btn btn-sm btn-success" disabled="disabled" type="button">Apply</button> and other one <button class="applyBtn btn btn-sm btn-success" type="button">Apply</button> The button is control by javascript to show the disable one or not How can i want the UDF click this butto when it was enable?. This is my code $sElement222 = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@class='applyBtn btn btn-sm btn-success']") _WD_ElementAction($sSession, $sElement222, 'click') Are this UDF can click the seconds enable button, hope anybody can help me. Edited January 11, 2019 by fagh81 Link to comment Share on other sites More sharing options...
Danp2 Posted January 11, 2019 Author Share Posted January 11, 2019 Have you tried adding "not(@disabled)" as part of your xpath locator? WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
Lunier Posted January 13, 2019 Share Posted January 13, 2019 Hello, i get the following error: __WD_Post: URL=HTTP://127.0.0.1:9515/session/60735297ef5fae98bfc3aa4ceeb83dce/element/2e066b85-ddef-4ace-919d-c858e50b5700/value; $sData={"id":"2e066b85-ddef-4ace-919d-c858e50b5700", "text":"temp"} __WD_Post: StatusCode=500; ResponseText={"value":{"error":"unknown error","message":"'value' must be a list(Session infochrome=71.0.3578.98)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0107AA90+830096]\n\tOrdinal0 [0x0102581D+481309]\n\tOrdinal0 [0x00FFAC47+306247]\n\tOrdinal0 [0x00FC5DB1+89521]\n\tOrdinal0 [0x00FDAA9D+174749]\n\tOrdinal0 [0x00FC4E28+85544]\n\tOrdinal0 [0x00FDAD31+175409]\n\tOrdinal0 [0x00FE208B+204939]\n\tOrdinal0 [0x00FDA93B+174395]\n\tOrdinal0 [0x00FC2D54+77140]\n\tOrdinal0 [0x00FC430C+82700]\n\tOrdinal0 [0x00FC4260+82528]\n\tOrdinal0 [0x01085302+873218]\n\tOrdinal0 [0x01030553+525651]\n\tOrdinal0 [0x01030783+526211]\n\tOrdinal0 [0x0103086C+526444]\n\tOrdinal0 [0x010883A7+885671]\n\tOrdinal0 [0x010303BF+525247]\n\tOrdinal0 [0x0103A60E+566798]\n\tOrdinal0 [0x01045DDB+613851]\n\tOrdinal0 [0x01045F45+614213]\n\tOrdinal0 [0x01045175+610677]\n\tBaseThreadInitThunk [0x74F08484+36]\n\tRtlAreBitsSet [0x77573AB8+136]\n\tRtlAreBitsSet [0x77573A88+88]\n"}} _WD_ElementAction: {"value":{"error":"unknown error","message":"'value' must be a list(Session infochrome=71.0.3578.98)... _WD_ElementAction ==> Webdriver Exception: {"value":{"error":"unknown error","message":"'value' must be a list(Session infochrome=71.0.3578.98)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0107AA90+830096]\n\tOrdinal0 [0x0102581D+481309]\n\tOrdinal0 [0x00FFAC47+306247]\n\tOrdinal0 [0x00FC5DB1+89521]\n\tOrdinal0 [0x00FDAA9D+174749]\n\tOrdinal0 [0x00FC4E28+85544]\n\tOrdinal0 [0x00FDAD31+175409]\n\tOrdinal0 [0x00FE208B+204939]\n\tOrdinal0 [0x00FDA93B+174395]\n\tOrdinal0 [0x00FC2D54+77140]\n\tOrdinal0 [0x00FC430C+82700]\n\tOrdinal0 [0x00FC4260+82528]\n\tOrdinal0 [0x01085302+873218]\n\tOrdinal0 [0x01030553+525651]\n\tOrdinal0 [0x01030783+526211]\n\tOrdinal0 [0x0103086C+526444]\n\tOrdinal0 [0x010883A7+885671]\n\tOrdinal0 [0x010303BF+525247]\n\tOrdinal0 [0x0103A60E+566798]\n\tOrdinal0 [0x01045DDB+613851]\n\tOrdinal0 [0x01045F45+614213]\n\tOrdinal0 [0x01045175+610677]\n\tBaseThreadInitThunk [0x74F08484+36]\n\tRtlAreBitsSet [0x77573AB8+136]\n\tRtlAreBitsSet [0x77573A88+88]\n"}} with this code: #include "wd_core.au3" #include "wd_helper.au3" Local $sSession, $sDesiredCapabilities SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) StartRegistration() _WD_Shutdown() Func StartRegistration() _WD_Navigate($sSession, "https://www.dazn.com/de-DE") _WD_LoadWait($sSession) _WD_Navigate($sSession, "https://www.dazn.com/de-DE/account/signup") _WD_LoadWait($sSession) $firstName = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='firstName']") _WD_ElementAction($sSession, $firstName , 'value', "temp") EndFunc Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true }}}}' EndFunc I just want to fill in some value into the firstname field, but i always get the error: value must be a list. Can someone help me? Link to comment Share on other sites More sharing options...
Danp2 Posted January 13, 2019 Author Share Posted January 13, 2019 @Lunier What version Chrome? Chromedriver? Also, what version of the UDF? FWIW, I'm not seeing this same error. I did modify your StartRegistration function as follows to deal with the opening animation -- Func StartRegistration() _WD_Navigate($sSession, "https://www.dazn.com/de-DE/account/signup") _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='firstName']") $firstName = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@name='firstName']") _WD_ElementAction($sSession, $firstName , 'value', "temp") EndFunc WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
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