
Wo0ki3
Members-
Posts
6 -
Joined
-
Last visited
Wo0ki3's Achievements

Seeker (1/7)
0
Reputation
-
WebDriver UDF - Help & Support (III)
Wo0ki3 replied to Danp2's topic in AutoIt General Help and Support
Hey, I have a problem with automatic log in to google services. I have an error like in screenshot. Code looks fine. I am using it with Twitter and few other services but I stuck on Google 😕 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"], "useAutomationExtension": false }}}}' EndFunc chrome.log -
WebDriver UDF - Help & Support (II)
Wo0ki3 replied to Danp2's topic in AutoIt General Help and Support
Your sample clarifies a lot for me! Thank you What about when the button doesn't have a "name"? <button class="button primary ng-binding" ng-click="$ctrl.loginReadOnly()"> Login Read-Only </button> EDIT: I have installed the chropath on Edge and it helps a lot. Much better than the other addons. But still, this button that I posted earlier, I can't click it 😕 -
WebDriver UDF - Help & Support (II)
Wo0ki3 replied to Danp2's topic in AutoIt General Help and Support
How do you locate the XPath? I tried some chrome extensions, but the code that I am getting from them don't work with my scripts 😕 For example, I am trying to click on Accept on: https://fortigate.fortidemo.com/login. My xpath is: /html/body/div[1]/div/div/div[3]/div/form/button[1] in my code: $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[1]/div/div/div[3]/div/form/button[1]") _WD_ElementAction($sSession, $sButton, 'click') -
WebDriver UDF - Help & Support (II)
Wo0ki3 replied to Danp2's topic in AutoIt General Help and Support
Does Chromedriver need to be at the same version as Chrome? After update my chromedriver version is 88.0.4324.96 and chrome is 88.0.4324.104. My code: #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sElement SetupChrome () $sUsername = $CmdLine[1] $Password = $CmdLine[2] _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://twitter.com/login") $sElement = _WD_GetElementByName($sSession, "session[username_or_email]") If Not @error Then _WD_SetElementValue($sSession, $sElement, $sUsername) $sElement = _WD_GetElementByName($sSession, "session[password]") If Not @error Then _WD_SetElementValue($sSession, $sElement, $Password) _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"], "useAutomationExtension": false }}}}' EndFunc -
WebDriver UDF - Help & Support (II)
Wo0ki3 replied to Danp2's topic in AutoIt General Help and Support
Hello, I am trying to pass variable from keyboard using: $sUsername = $CmdLine[1] sPassword = $CmdLine[2] and put it into fields on the twitter login page: $sElement = _WD_GetElementByName($sSession, "session[username_or_email]") If Not @error Then _WD_SetElementValue($sSession, $sElement, $sUsername) $sElement = _WD_GetElementByName($sSession, "session[password]") If Not @error Then _WD_SetElementValue($sSession, $sElement, sPassword) I worked few times, but after few compilations it can't find my elements 😕 log: [1611692694.520][INFO]: Starting ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761}) on port 9515 [1611692694.521][INFO]: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. [1611692694.956][INFO]: [70de11a33707d3a412d284f637f6b084] COMMAND InitSession { "capabilities": { "alwaysMatch": { "goog:chromeOptions": { "excludeSwitches": [ "enable-automation" ], "useAutomationExtension": false, "w3c": true } } } } [1611692694.957][WARNING]: Deprecated chrome option is ignored: useAutomationExtension [1611692694.957][WARNING]: Deprecated chrome option is ignored: useAutomationExtension [1611692694.960][INFO]: Populating Preferences file: { "alternate_error_pages": { "enabled": false }, "autofill": { "enabled": false }, "browser": { "check_default_browser": false }, "distribution": { "import_bookmarks": false, "import_history": false, "import_search_engine": false, "make_chrome_default_for_user": false, "skip_first_run_ui": true }, "dns_prefetching": { "enabled": false }, "profile": { "content_settings": { "pattern_pairs": { "https://*,*": { "media-stream": { "audio": "Default", "video": "Default" } } } }, "default_content_setting_values": { "geolocation": 1 }, "default_content_settings": { "geolocation": 1, "mouselock": 1, "notifications": 1, "popups": 1, "ppapi-broker": 1 }, "password_manager_enabled": false }, "safebrowsing": { "enabled": false }, "search": { "suggest_enabled": false }, "translate": { "enabled": false } } [1611692694.961][INFO]: Populating Local State file: { "background_mode": { "enabled": false }, "ssl": { "rev_checking": { "enabled": false } } } [1611692694.963][INFO]: Launching chrome: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-background-networking --disable-backgrounding-occluded-windows --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-blink-features=ShadowDOMV0 --enable-logging --log-level=0 --no-first-run --no-service-autorun --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir="C:\Users\LUKASZ~1.RES\AppData\Local\Temp\2\scoped_dir912_374730974" data:, [1611692695.316][DEBUG]: DevTools HTTP Request: http://localhost:51295/json/version [1611692695.623][DEBUG]: DevTools HTTP Response: { "Browser": "Chrome/88.0.4324.104", "Protocol-Version": "1.3", "User-Agent": "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36", "V8-Version": "8.8.278.14", "WebKit-Version": "537.36 (@17905c015d3376dee9cce5dd079a3f4fa906e060)", "webSocketDebuggerUrl": "ws://localhost:51295/devtools/browser/14477ca1-b247-4d73-8468-f00d0aab3e70" } [1611692695.624][WARNING]: This version of ChromeDriver has not been tested with Chrome version 88. [1611692695.624][DEBUG]: DevTools HTTP Request: http://localhost:51295/json/list [1611692695.626][DEBUG]: DevTools HTTP Response: [ { "description": "", "devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:51295/devtools/page/B91126E4F2D920E2F4EC9F74B8C9DAD9", "id": "B91126E4F2D920E2F4EC9F74B8C9DAD9", "title": "", "type": "page", "url": "data:,", "webSocketDebuggerUrl": "ws://localhost:51295/devtools/page/B91126E4F2D920E2F4EC9F74B8C9DAD9" } ] [1611692695.626][DEBUG]: DevTools HTTP Request: http://localhost:51295/json/list [1611692695.627][DEBUG]: DevTools HTTP Response: [ { "description": "", "devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:51295/devtools/page/B91126E4F2D920E2F4EC9F74B8C9DAD9", "id": "B91126E4F2D920E2F4EC9F74B8C9DAD9", "title": "", "type": "page", "url": "data:,", "webSocketDebuggerUrl": "ws://localhost:51295/devtools/page/B91126E4F2D920E2F4EC9F74B8C9DAD9" } ] [1611692695.630][INFO]: resolved localhost to ["::1","127.0.0.1"] [1611692696.639][DEBUG]: DevTools WebSocket Command: Page.addScriptToEvaluateOnNewDocument (id=1) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "source": "(function () {window.cdc_adoQpoasnfa76pfcZLmcfl_Array = window.Array;window.cdc_adoQpoasnfa76pfcZLmcfl_Promise = window.Promise;window.cdc_adoQpoasnfa76pfcZLmcfl_Symbol = window.Symbol;}) ();" } [1611692696.639][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=2) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "(function () {window.cdc_adoQpoasnfa76pfcZLmcfl_Array = window.Array;window.cdc_adoQpoasnfa76pfcZLmcfl_Promise = window.Promise;window.cdc_adoQpoasnfa76pfcZLmcfl_Symbol = window.Symbol;}) ();" } [1611692696.639][DEBUG]: DevTools WebSocket Command: Log.enable (id=3) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.639][DEBUG]: DevTools WebSocket Command: DOM.getDocument (id=4) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.640][DEBUG]: DevTools WebSocket Command: Target.setAutoAttach (id=5) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "autoAttach": true, "flatten": true, "waitForDebuggerOnStart": false } [1611692696.640][DEBUG]: DevTools WebSocket Command: Page.enable (id=6) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.640][DEBUG]: DevTools WebSocket Command: Page.enable (id=7) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.640][DEBUG]: DevTools WebSocket Response: Page.addScriptToEvaluateOnNewDocument (id=1) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "identifier": "1" } [1611692696.640][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=2) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "type": "undefined" } } [1611692696.640][DEBUG]: DevTools WebSocket Response: Log.enable (id=3) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.640][DEBUG]: DevTools WebSocket Response: DOM.getDocument (id=4) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "root": { "backendNodeId": 2, "baseURL": "data:,", "childNodeCount": 1, "children": [ { "attributes": [ ], "backendNodeId": 3, "childNodeCount": 2, "children": [ { "attributes": [ ], "backendNodeId": 4, "childNodeCount": 0, "localName": "head", "nodeId": 3, "nodeName": "HEAD", "nodeType": 1, "nodeValue": "", "parentId": 2 }, { "attributes": [ ], "backendNodeId": 5, "childNodeCount": 0, "localName": "body", "nodeId": 4, "nodeName": "BODY", "nodeType": 1, "nodeValue": "", "parentId": 2 } ], "frameId": "B91126E4F2D920E2F4EC9F74B8C9DAD9", "localName": "html", "nodeId": 2, "nodeName": "HTML", "nodeType": 1, "nodeValue": "", "parentId": 1 } ], "documentURL": "data:,", "localName": "", "nodeId": 1, "nodeName": "#document", "nodeType": 9, "nodeValue": "", "xmlVersion": "" } } [1611692696.641][DEBUG]: DevTools WebSocket Response: Target.setAutoAttach (id=5) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.641][DEBUG]: DevTools WebSocket Response: Page.enable (id=6) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.641][DEBUG]: DevTools WebSocket Response: Page.enable (id=7) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.641][DEBUG]: DevTools WebSocket Command: Runtime.enable (id=8) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.641][DEBUG]: DevTools WebSocket Event: Runtime.executionContextCreated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "context": { "auxData": { "frameId": "B91126E4F2D920E2F4EC9F74B8C9DAD9", "isDefault": true, "type": "default" }, "id": 1, "name": "", "origin": "://" } } [1611692696.641][DEBUG]: DevTools WebSocket Response: Runtime.enable (id=8) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.641][DEBUG]: DevTools WebSocket Command: Page.enable (id=9) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.642][DEBUG]: DevTools WebSocket Response: Page.enable (id=9) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.642][DEBUG]: DevTools WebSocket Command: Runtime.enable (id=10) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.643][DEBUG]: DevTools WebSocket Response: Runtime.enable (id=10) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.643][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=11) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "awaitPromise": true, "expression": "(function() { // Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/**\n * Enum f...", "returnByValue": true } [1611692696.646][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=11) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "type": "object", "value": { "status": 0, "value": 1 } } } [1611692696.646][INFO]: [70de11a33707d3a412d284f637f6b084] RESPONSE InitSession { "capabilities": { "acceptInsecureCerts": false, "browserName": "chrome", "browserVersion": "88.0.4324.104", "chrome": { "chromedriverVersion": "87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761})", "userDataDir": "C:\\Users\\LUKASZ~1.RES\\AppData\\Local\\Temp\\2\\scoped_dir912_374730974" }, "goog:chromeOptions": { "debuggerAddress": "localhost:51295" }, "networkConnectionEnabled": false, "pageLoadStrategy": "normal", "platformName": "windows", "proxy": { }, "setWindowRect": true, "strictFileInteractability": false, "timeouts": { "implicit": 0, "pageLoad": 300000, "script": 30000 }, "unhandledPromptBehavior": "dismiss and notify", "webauthn:virtualAuthenticators": true }, "sessionId": "70de11a33707d3a412d284f637f6b084" } [1611692696.664][INFO]: [70de11a33707d3a412d284f637f6b084] COMMAND Navigate { "url": "https://twitter.com/login" } [1611692696.664][INFO]: Waiting for pending navigations... [1611692696.664][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=12) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692696.665][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=12) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692696.665][DEBUG]: DevTools WebSocket Command: DOM.getDocument (id=13) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.666][DEBUG]: DevTools WebSocket Response: DOM.getDocument (id=13) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "root": { "backendNodeId": 2, "baseURL": "data:,", "childNodeCount": 1, "children": [ { "attributes": [ ], "backendNodeId": 3, "childNodeCount": 2, "children": [ { "attributes": [ ], "backendNodeId": 4, "childNodeCount": 0, "localName": "head", "nodeId": 7, "nodeName": "HEAD", "nodeType": 1, "nodeValue": "", "parentId": 6 }, { "attributes": [ ], "backendNodeId": 5, "childNodeCount": 0, "localName": "body", "nodeId": 8, "nodeName": "BODY", "nodeType": 1, "nodeValue": "", "parentId": 6 } ], "frameId": "B91126E4F2D920E2F4EC9F74B8C9DAD9", "localName": "html", "nodeId": 6, "nodeName": "HTML", "nodeType": 1, "nodeValue": "", "parentId": 5 } ], "documentURL": "data:,", "localName": "", "nodeId": 5, "nodeName": "#document", "nodeType": 9, "nodeValue": "", "xmlVersion": "" } } [1611692696.666][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=14) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "awaitPromise": false, "expression": "document.readyState", "returnByValue": true } [1611692696.666][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=14) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "type": "string", "value": "complete" } } [1611692696.666][INFO]: Done waiting for pending navigations. Status: ok [1611692696.666][DEBUG]: DevTools WebSocket Command: Page.navigate (id=15) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "url": "https://twitter.com/login" } [1611692696.876][DEBUG]: DevTools WebSocket Response: Page.navigate (id=15) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "frameId": "B91126E4F2D920E2F4EC9F74B8C9DAD9", "loaderId": "8315E2A145DE20186A28C85BB38DCA06" } [1611692696.876][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=16) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "document.URL" } [1611692696.878][DEBUG]: DevTools WebSocket Event: Runtime.executionContextsCleared B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.879][DEBUG]: DevTools WebSocket Event: Page.frameStartedLoading B91126E4F2D920E2F4EC9F74B8C9DAD9 { "frameId": "B91126E4F2D920E2F4EC9F74B8C9DAD9" } [1611692696.893][DEBUG]: DevTools WebSocket Event: Runtime.executionContextsCleared B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.893][DEBUG]: DevTools WebSocket Event: Page.frameNavigated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "frame": { "adFrameType": "none", "crossOriginIsolatedContextType": "NotIsolated", "domainAndRegistry": "twitter.com", "gatedAPIFeatures": [ "SharedArrayBuffers", "SharedArrayBuffersTransferAllowed" ], "id": "B91126E4F2D920E2F4EC9F74B8C9DAD9", "loaderId": "8315E2A145DE20186A28C85BB38DCA06", "mimeType": "text/html", "secureContextType": "Secure", "securityOrigin": "https://twitter.com", "url": "https://twitter.com/login" } } [1611692696.893][DEBUG]: DevTools WebSocket Event: DOM.documentUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.893][DEBUG]: DevTools WebSocket Command: DOM.getDocument (id=17) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692696.894][DEBUG]: DevTools WebSocket Event: Runtime.executionContextCreated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "context": { "auxData": { "frameId": "B91126E4F2D920E2F4EC9F74B8C9DAD9", "isDefault": true, "type": "default" }, "id": 1, "name": "", "origin": "https://twitter.com" } } [1611692696.900][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=16) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "type": "string", "value": "https://twitter.com/login" } } [1611692696.900][INFO]: Waiting for pending navigations... [1611692696.900][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=18) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692696.905][DEBUG]: DevTools WebSocket Response: DOM.getDocument (id=17) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "root": { "backendNodeId": 1, "baseURL": "https://twitter.com/login", "childNodeCount": 2, "children": [ { "backendNodeId": 2, "localName": "", "nodeId": 2, "nodeName": "html", "nodeType": 10, "nodeValue": "", "parentId": 1, "publicId": "", "systemId": "" }, { "attributes": [ "dir", "ltr", "lang", "en" ], "backendNodeId": 3, "childNodeCount": 2, "children": [ { "attributes": [ ], "backendNodeId": 4, "childNodeCount": 82, "localName": "head", "nodeId": 4, "nodeName": "HEAD", "nodeType": 1, "nodeValue": "", "parentId": 3 }, { "attributes": [ ], "backendNodeId": 5, "childNodeCount": 2, "localName": "body", "nodeId": 5, "nodeName": "BODY", "nodeType": 1, "nodeValue": "", "parentId": 3 } ], "frameId": "B91126E4F2D920E2F4EC9F74B8C9DAD9", "localName": "html", "nodeId": 3, "nodeName": "HTML", "nodeType": 1, "nodeValue": "", "parentId": 1 } ], "documentURL": "https://twitter.com/login", "localName": "", "nodeId": 1, "nodeName": "#document", "nodeType": 9, "nodeValue": "", "xmlVersion": "" } } [1611692696.906][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=18) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692696.918][DEBUG]: DevTools WebSocket Event: DOM.childNodeCountUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "childNodeCount": 3, "nodeId": 5 } [1611692696.918][DEBUG]: DevTools WebSocket Event: DOM.childNodeCountUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "childNodeCount": 4, "nodeId": 5 } [1611692696.918][DEBUG]: DevTools WebSocket Event: DOM.childNodeCountUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "childNodeCount": 5, "nodeId": 5 } [1611692696.918][DEBUG]: DevTools WebSocket Event: DOM.childNodeCountUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "childNodeCount": 6, "nodeId": 5 } [1611692696.918][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=19) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692696.919][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=19) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692696.989][DEBUG]: DevTools WebSocket Event: DOM.childNodeCountUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "childNodeCount": 7, "nodeId": 5 } [1611692696.989][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=20) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692696.990][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=20) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692697.055][DEBUG]: DevTools WebSocket Event: DOM.childNodeCountUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "childNodeCount": 8, "nodeId": 5 } [1611692697.055][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=21) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692697.055][DEBUG]: DevTools WebSocket Event: DOM.childNodeCountUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "childNodeCount": 9, "nodeId": 5 } [1611692697.056][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=21) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692697.277][DEBUG]: DevTools WebSocket Event: DOM.childNodeCountUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "childNodeCount": 83, "nodeId": 4 } [1611692697.277][DEBUG]: DevTools WebSocket Event: DOM.childNodeCountUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "childNodeCount": 10, "nodeId": 5 } [1611692697.277][DEBUG]: DevTools WebSocket Event: DOM.childNodeCountUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { "childNodeCount": 11, "nodeId": 5 } [1611692697.277][DEBUG]: DevTools WebSocket Event: DOM.documentUpdated B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692697.277][DEBUG]: DevTools WebSocket Command: DOM.getDocument (id=22) B91126E4F2D920E2F4EC9F74B8C9DAD9 { } [1611692697.277][DEBUG]: DevTools WebSocket Event: Page.domContentEventFired B91126E4F2D920E2F4EC9F74B8C9DAD9 { "timestamp": 254704.946914 } [1611692697.277][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=23) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692697.282][DEBUG]: DevTools WebSocket Response: DOM.getDocument (id=22) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "root": { "backendNodeId": 1, "baseURL": "https://twitter.com/login", "childNodeCount": 2, "children": [ { "backendNodeId": 2, "localName": "", "nodeId": 7, "nodeName": "html", "nodeType": 10, "nodeValue": "", "parentId": 6, "publicId": "", "systemId": "" }, { "attributes": [ "dir", "ltr", "lang", "en", "style", "overflow-y: scroll; overscroll-behavior-y: none;" ], "backendNodeId": 3, "childNodeCount": 2, "children": [ { "attributes": [ ], "backendNodeId": 4, "childNodeCount": 83, "localName": "head", "nodeId": 9, "nodeName": "HEAD", "nodeType": 1, "nodeValue": "", "parentId": 8 }, { "attributes": [ ], "backendNodeId": 5, "childNodeCount": 11, "localName": "body", "nodeId": 10, "nodeName": "BODY", "nodeType": 1, "nodeValue": "", "parentId": 8 } ], "frameId": "B91126E4F2D920E2F4EC9F74B8C9DAD9", "localName": "html", "nodeId": 8, "nodeName": "HTML", "nodeType": 1, "nodeValue": "", "parentId": 6 } ], "documentURL": "https://twitter.com/login", "localName": "", "nodeId": 6, "nodeName": "#document", "nodeType": 9, "nodeValue": "", "xmlVersion": "" } } [1611692697.282][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=23) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692697.284][DEBUG]: DevTools WebSocket Event: Page.loadEventFired B91126E4F2D920E2F4EC9F74B8C9DAD9 { "timestamp": 254704.953655 } [1611692697.285][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=24) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "awaitPromise": false, "expression": "document.readyState", "returnByValue": true } [1611692697.285][DEBUG]: DevTools WebSocket Event: Page.frameStoppedLoading B91126E4F2D920E2F4EC9F74B8C9DAD9 { "frameId": "B91126E4F2D920E2F4EC9F74B8C9DAD9" } [1611692697.285][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=24) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "type": "string", "value": "complete" } } [1611692697.285][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=25) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692697.286][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=25) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692697.286][INFO]: Done waiting for pending navigations. Status: ok [1611692697.286][INFO]: [70de11a33707d3a412d284f637f6b084] RESPONSE Navigate [1611692697.290][INFO]: [70de11a33707d3a412d284f637f6b084] COMMAND FindElement { "using": "xpath", "value": "//*[@name=\"session[username_or_email]\"]" } [1611692697.290][INFO]: Waiting for pending navigations... [1611692697.291][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=26) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692697.291][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=26) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692697.291][INFO]: Done waiting for pending navigations. Status: ok [1611692697.293][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=27) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "awaitPromise": true, "expression": "(function() { // Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/**\n * Enum f...", "returnByValue": true } [1611692697.301][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=27) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "type": "object", "value": { "status": 0, "value": null } } } [1611692697.301][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=28) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692697.302][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=28) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692697.302][INFO]: Waiting for pending navigations... [1611692697.302][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=29) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692697.302][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=29) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692697.302][INFO]: Done waiting for pending navigations. Status: ok [1611692697.302][INFO]: [70de11a33707d3a412d284f637f6b084] RESPONSE FindElement ERROR no such element: Unable to locate element: {"method":"xpath","selector":"//*[@name="session[username_or_email]"]"} (Session info: chrome=88.0.4324.104) [1611692697.308][INFO]: [70de11a33707d3a412d284f637f6b084] COMMAND FindElement { "using": "xpath", "value": "//*[@name=\"session[password]\"]" } [1611692697.308][INFO]: Waiting for pending navigations... [1611692697.308][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=30) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692697.309][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=30) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692697.309][INFO]: Done waiting for pending navigations. Status: ok [1611692697.311][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=31) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "awaitPromise": true, "expression": "(function() { // Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/**\n * Enum f...", "returnByValue": true } [1611692697.317][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=31) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "type": "object", "value": { "status": 0, "value": null } } } [1611692697.317][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=32) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692697.318][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=32) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692697.318][INFO]: Waiting for pending navigations... [1611692697.318][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=33) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "expression": "1" } [1611692697.318][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=33) B91126E4F2D920E2F4EC9F74B8C9DAD9 { "result": { "description": "1", "type": "number", "value": 1 } } [1611692697.318][INFO]: Done waiting for pending navigations. Status: ok [1611692697.318][INFO]: [70de11a33707d3a412d284f637f6b084] RESPONSE FindElement ERROR no such element: Unable to locate element: {"method":"xpath","selector":"//*[@name="session[password]"]"} (Session info: chrome=88.0.4324.104) -
WebDriver UDF - Help & Support (II)
Wo0ki3 replied to Danp2's topic in AutoIt General Help and Support
Hello, I have started to work with WebDriver recently and I,m trying to automate it with my PAM solution. Right now, I probably stuck with XPath. The page is loading, but the pass and username are blank. #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession SetupChrome () _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://twitter.com/login") _ChromeSetInputValueById($sSession,'session[username_or_email]','test') _ChromeSetInputValueById($sSession,'session[password]','1321321321321231321321321') _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"], "useAutomationExtension": false }}}}' EndFunc Func _ChromeSetInputValueById($sSession,$Id,$Value) Local $sElement, $aElements, $sValue, $sButton, $sResponse, $bDecode, $sDecode, $hFileOpen $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id="react-root"]/div/div/div[2]/main/div/div/div[1]/form/div/div[1]/label/div/div[2]/div/input") _WD_ElemetAction($sSession,$sButton,'value', $Value) EndFunc