VodkaDiva 2 Posted January 18 Share Posted January 18 (edited) @Danp2 After more than 1 year I don't use Webdriver . and i installed windows 10. but i can't turn on chrome , even though i tried your demo file . (I have updated chrome + installed chrome driver according to the version of chrome . + updated to the latest version of UDF) ! @ScriptLineNumber = 297 ! _WD_Capabilities: API START: 485 - $_WD_CAPS__API: Rows= 1 - $_WD_CAPS__API: Cols= 12 alwaysMatch|||-1||goog:chromeOptions||-1||||0 ! _WD_Capabilities: API END: 485 ! _WD_Capabilities: JSON START: 485 { "capabilities":{ "alwaysMatch":{ "goog:chromeOptions":{ "w3c":true, "excludeSwitches":[ "enable-automation" ] } } } } ! _WD_Capabilities: JSON END: 485 _WD_Startup: "chromedriver.exe" --verbose --log-path="D:\Selenium\Change TMAC Theo Profile\chrome.log" __WD_Post ==> Webdriver Exception: {"value":{"error":"unknown error","message":"unknown error: Chrome failed to start: crashed.\n (unknown error: DevToolsActivePort file doesn't exist)\n (The process started from chrome location C:\\Users\\thieu\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0078FDC3+2555331]\n\tOrdinal0 [0x007277F1+2127857]\n\tOrdinal0 [0x00622E08+1060360]\n\tOrdinal0 [0x0063EA4A+1174090]\n\tOrdinal0 [0x0063AFC1+1159105]\n\tOrdinal0 [0x0066C22F+1360431]\n\tOrdinal0 [0x0066BE9A+1359514]\n\tOrdinal0 [0x00667976+1341814]\n\tOrdinal0 [0x006436B6+1193654]\n\tOrdinal0 [0x00644546+1197382]\n\tGetHandleVerifier [0x00929622+1619522]\n\tGetHandleVerifier [0x009D882C+2336844]\n\tGetHandleVerifier [0x008223E1+541697]\n\tGetHandleVerifier [0x00821443+537699]\n\tOrdinal0 [0x0072D18E+2150798]\n\tOrdinal0 [0x00731518+2168088]\n\tOrdinal0 [0x00731660+2168416]\n\tOrdinal0 [0x0073B330+2208560]\n\tBaseThreadInitThunk [0x7731FA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77CB7A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77CB7A6E+238]\n"}} _WD_CreateSession ==> Webdriver Exception: HTTP status = 500 Can you help me see why it's wrong? Thanks for your time. Have a nice day Edited January 18 by VodkaDiva xxxxxxxxxxx Link to post Share on other sites
mLipok 1,303 Posted January 18 Share Posted January 18 Here is written Chrome failed to start: crashed.\n (unknown error: DevToolsActivePort file doesn't exist)\n (The process started from chrome location C:\\Users\\thieu\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Are you able to run Google Chrome browser from your's desktop icon ? Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2022-03-07 Link to post Share on other sites
Danp2 1,230 Posted January 18 Author Share Posted January 18 20 minutes ago, VodkaDiva said: The process started from chrome location C:\\Users\\thieu\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe is no longer running Not sure that it matters, but my Chrome is installed under C:\Program Files\Google\Chrome\Application. Quote (unknown error: DevToolsActivePort file doesn't exist) I've seen other instances online where users experienced this same error. You may want to research to see if there is a simple fix. WebDriver UDF [GH&S] Latest version Wiki FAQs Link to post Share on other sites
VodkaDiva 2 Posted January 18 Share Posted January 18 1 hour ago, mLipok said: Here is written Chrome failed to start: crashed.\n (unknown error: DevToolsActivePort file doesn't exist)\n (The process started from chrome location C:\\Users\\thieu\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.) Are you able to run Google Chrome browser from your's desktop icon ? I can run chrome normally. But it cannot be opened via WEBdriver . :( xxxxxxxxxxx Link to post Share on other sites
VodkaDiva 2 Posted January 18 Share Posted January 18 I found out because :ChromeDriver was unable to find the Chrome binary in the default location And it is further processed binary.location: Here is the sample code in java options = Options() options.binary_location = "C:\\Program Files\\Chrome\\chrome64_55.0.2883.75\\chrome.exe" And I tried the autoit side but still not working . I don't know where I went wrong $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"],"binary_location":"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"}}}}' Thank @mLipok , Thank @Danp2 xxxxxxxxxxx Link to post Share on other sites
Danp2 1,230 Posted January 18 Author Share Posted January 18 @VodkaDivaHave you checked to see if an instance of Chrome exists at this location on your system? C:\\Users\\thieu\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe See the Webdriver Wiki FAQs in my sig. There's an entry that explains the correct way to point to the Chrome executable. VodkaDiva 1 WebDriver UDF [GH&S] Latest version Wiki FAQs Link to post Share on other sites
VodkaDiva 2 Posted January 19 Share Posted January 19 @Danp2 You are the best. I followed that link and deleted it. And it worked Thank you, good luck, and good health to you. xxxxxxxxxxx Link to post Share on other sites
taylansan 7 Posted January 24 Share Posted January 24 Hi @Danp2 I have the very first problem ever. I can't run wd_demo. My autoit version: 3.3.14.5 & SciTE version: Version 4.1.2 I'm using release 0.5.1.0 from Github. I also have WinHttp.au3 and Json.au3 in the folder too: I only change the Browser option as Edge or Chrome. After running the wd_demo, I have the below output: expandcollapse popup>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\wd_demo.au3" /UserParams +>12:13:31 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0 Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\wd_demo.au3 +>12:13:32 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\wd_demo.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop ! @ScriptLineNumber = 297 ! _WD_Capabilities: API START: 499 - $_WD_CAPS__API: Rows= 1 - $_WD_CAPS__API: Cols= 12 alwaysMatch|||-1||ms:edgeOptions||-1||||0 ! _WD_Capabilities: API END: 499 ! _WD_Capabilities: JSON START: 499 { "capabilities":{ "alwaysMatch":{ "ms:edgeOptions":{ "excludeSwitches":[ "enable-automation" ] } } } } ! _WD_Capabilities: JSON END: 499 _WD_IsLatestRelease: True _WD_IsLatestRelease ==> Success _WD_Startup: OS: WIN_10 WIN32_NT 19043 _WD_Startup: AutoIt: 3.3.14.5 _WD_Startup: WD.au3: 0.5.1.0 (Up to date) _WD_Startup: WinHTTP: 1.6.4.2 _WD_Startup: Driver: msedgedriver.exe _WD_Startup: Params: --verbose --log-path="D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\msedge.log" _WD_Startup: Port: 9515 _WD_Startup ==> General Error: Error launching web driver! +>12:13:41 AutoIt3.exe ended.rc:0 +>12:13:41 AutoIt3Wrapper Finished. >Exit code: 0 Time: 9.685 1. I didn't modify anything in the code nor in the demo. I "think" my browsers are up to date too. What could I be missing? 2. I tried to open the help file (chm), but the content is empty. I only see the functions on the left, but there's no description on the right. Thanks in advance TY. Link to post Share on other sites
Danp2 1,230 Posted January 24 Author Share Posted January 24 18 minutes ago, taylansan said: I only change the Browser option as Edge or Chrome. After running the wd_demo, I have the below output: In the output you posted, it's looking for the actual webdriver (msedgedriver.exe). Have you installed that in your working directory? Quote I tried to open the help file (chm), but the content is empty. I only see the functions on the left, but there's no description on the right. You'll need to unblock the file. Details copied from here -- Quote Please try this step and let us know if it works: 1. Right click on the .CHM you want to open and click on Properties. 2. Under the General tab, check the option called Unblock. 3. Click on Apply and OK. taylansan 1 WebDriver UDF [GH&S] Latest version Wiki FAQs Link to post Share on other sites
taylansan 7 Posted January 24 Share Posted January 24 It seems that it worked now. Thank you. I'll see more if I have some more newb questions. TY. Link to post Share on other sites
Danp2 1,230 Posted January 24 Author Share Posted January 24 FYI, next version of wd_demo will include support for automatically installing / updating the webdriver via _WD_UpdateDriver. Thanks goes to @mLipokfor adding these improvements. WebDriver UDF [GH&S] Latest version Wiki FAQs Link to post Share on other sites
taylansan 7 Posted January 25 Share Posted January 25 Hello @Danp2 I wanted to click the "Subscriptions" in the Youtube page. As a first step, I inspected the page and found the details: Screenshot cannot show properly, this is the details of the element: <a id="endpoint" tabindex="-1" class="yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer" title="Subscriptions" href="/feed/subscriptions"> <yt-icon id="icon" class="guide-icon style-scope ytd-mini-guide-entry-renderer"><svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g class="style-scope yt-icon"><path d="M10,18v-6l5,3L10,18z M17,3H7v1h10V3z M20,6H4v1h16V6z M22,9H2v12h20V9z M3,10h18v10H3V10z" class="style-scope yt-icon"></path></g></svg><!--css-build:shady--></yt-icon> <span class="title style-scope ytd-mini-guide-entry-renderer">Subscriptions</span> <tp-yt-paper-tooltip animation-delay="0" offset="4" position="right" class="style-scope ytd-mini-guide-entry-renderer" role="tooltip" tabindex="-1" hidden="" style="--paper-tooltip-delay-in:0ms;"><!--css-build:shady--><div id="tooltip" class="style-scope tp-yt-paper-tooltip hidden"> Subscriptions </div> </tp-yt-paper-tooltip> <yt-interaction class="style-scope ytd-mini-guide-entry-renderer"><!--css-build:shady--><div class="stroke style-scope yt-interaction"></div><div class="fill style-scope yt-interaction"></div></yt-interaction> </a> Without knowing too much, I check that: It starts with "a" It has class named as "yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer" It has title as "Subscriptions" So, I created my code, filling all these informations: #include "wd_core.au3" #include "wd_helper.au3" #include "wd_capabilities.au3" $sDesiredCapabilities = SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.youtube.com") $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']") _WD_ElementAction($sSession, $sElement, 'click') MsgBox(0,"","") _WD_DeleteSession($sSession) _WD_Shutdown() Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') ;~ Local $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"]}}}}' _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sDesiredCapabilities = _WD_CapabilitiesGet() Return $sDesiredCapabilities EndFunc ;==>SetupChrome When I look at my $sElement, it seemed like it's too big, and I'm not sure if the browser can find the element I wrote in the path. Yet it didn't: expandcollapse popup>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3" /UserParams +>00:00:30 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0 Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3 +>00:00:30 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop ! @ScriptLineNumber = 297 ! _WD_Capabilities: API START: 32 - $_WD_CAPS__API: Rows= 1 - $_WD_CAPS__API: Cols= 12 alwaysMatch|||-1||goog:chromeOptions||-1||||0 ! _WD_Capabilities: API END: 32 ! _WD_Capabilities: JSON START: 32 { "capabilities":{ "alwaysMatch":{ "goog:chromeOptions":{ "w3c":true, "excludeSwitches":[ "enable-automation" ] } } } } ! _WD_Capabilities: JSON END: 32 _WD_IsLatestRelease: True _WD_IsLatestRelease ==> Success _WD_Startup: OS: WIN_10 WIN32_NT 19043 _WD_Startup: AutoIt: 3.3.14.5 _WD_Startup: WD.au3: 0.5.1.0 (Up to date) _WD_Startup: WinHTTP: 1.6.4.2 _WD_Startup: Driver: chromedriver.exe _WD_Startup: Params: --verbose --log-path="D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\chrome.log" _WD_Startup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={ "capabilities":{ "alwaysMatch":{ "goog:chromeOptions":{ "w3c":true, "excludeSwitches":[ "enable-automation" ] } } } } __WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"97.0.... _WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"97.0.4692.71","chrome":{"chromedriverVersion":"97.0.4692.71 (adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247})","userDataDir":"C:\\Users\\T00722~1\\AppData\\Local\\Temp\\scoped_dir40888_615928999"},"goog:chromeOptions":{"debuggerAddress":"localhost:57086"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:extension:credBlob":true,"webauthn:extension:largeBlob":true,"webauthn:virtualAuthenticators":true},"sessionId":"d5c403dd6f40c1ff1471f913cae480ab"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab/url; $sData={"url":"https://www.youtube.com"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_Navigate: {"value":null} __WD_Post: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab/element; $sData={"using":"xpath","value":"//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']"} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\... __WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']\"}\n (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097E49E+1238174]\n\tOrdinal0 [0x0097E69B+1238683]\n\tOrdinal0 [0x009A9252+1413714]\n\tOrdinal0 [0x00997B54+1342292]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} _WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']\"}\n (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097E49E+1238174]\n\tOrdinal0 [0x0097E69B+1238683]\n\tOrdinal0 [0x009A9252+1413714]\n\tOrdinal0 [0x00997B54+1342292]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} _WD_FindElement ==> No match: HTTP status = 404 __WD_Post: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab/element//click; $sData={"id":""} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n (Ses... __WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097DC11+1235985]\n\tOrdinal0 [0x0097FC4E+1244238]\n\tOrdinal0 [0x00974ED6+1199830]\n\tOrdinal0 [0x00997B0C+1342220]\n\tOrdinal0 [0x00974984+1198468]\n\tOrdinal0 [0x00997C14+1342484]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} _WD_ElementAction: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n (Ses... _WD_ElementAction ==> No match: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097DC11+1235985]\n\tOrdinal0 [0x0097FC4E+1244238]\n\tOrdinal0 [0x00974ED6+1199830]\n\tOrdinal0 [0x00997B0C+1342220]\n\tOrdinal0 [0x00974984+1198468]\n\tOrdinal0 [0x00997C14+1342484]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} __WD_Delete: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab __WD_Delete: StatusCode=200; ResponseText={"value":null}... _WD_DeleteSession: {"value":null} +>00:03:21 AutoIt3.exe ended.rc:0 +>00:03:21 AutoIt3Wrapper Finished. >Exit code: 0 Time: 171.2 In the output, I found this: _WD_FindElement ==> No match: HTTP status = 404 Now I know, I couldn't address the correct thing correctly in the find element. But I don't know how to address this. If I just type the address, yeah it will work. But I wanted to manipulate a mouse click on that item. How can I do that? TY. Link to post Share on other sites
Danp2 1,230 Posted January 25 Author Share Posted January 25 SelectorsHub give a relative xpath of "//ytd-mini-guide-entry-renderer[@aria-label='Subscriptions']//a[@id='endpoint']", so I would try using that to see if it works. taylansan 1 WebDriver UDF [GH&S] Latest version Wiki FAQs Link to post Share on other sites
taylansan 7 Posted January 25 Share Posted January 25 I didn't know SelectorsHub, this really helps now. After installing it, something came to my eye that the driver (chromedriver) starts a completely new Chrome without taking any extensions or bookmarks. This questions is not related to the code, it's somehow related to the driver. If you don't reply, it's fine too. This is just double-clicking Chrome, I can see my bookmarks and extensions: But when I run Chrome using chromedriver, it acts like a completely new and untouched browser; no bookmarks and no extensions from the original: After installing SelectorsHub in Chrome launched by chromedriver and closing it, then re-launching another chromedriver: I can't see SelectorsHub anymore either. How can I force chromedriver to run Chrome with the existing settings (with the bookmarks + extensions)? TY. Link to post Share on other sites
Danp2 1,230 Posted January 25 Author Share Posted January 25 @taylansanThis is expected behavior. Each new webdriver session will start with a completely new profile unless you instruct otherwise. There are prior discussions on the forum dealing with this, and I also think there's some info in the wiki. WebDriver UDF [GH&S] Latest version Wiki FAQs Link to post Share on other sites
SOLVE-SMART 25 Posted January 25 Share Posted January 25 HI @taylansan, I think @Danp2 is referring to wiki > WebDriver > FAQ #3. In case you do have more questions about XPath selectors/locators (when SelectorsHub shouldn't be enough or precise enough), I offer my help. Because I deal with it almost every day at work 😉 . Best regards Sven ________________Stay innovative! Link to post Share on other sites
mLipok 1,303 Posted January 25 Share Posted January 25 Today I found an interesting demo page: https://stqatools.com/demo/index.php It can be handy for developing examples, practice, and solving problems. SOLVE-SMART 1 Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2022-03-07 Link to post Share on other sites
SOLVE-SMART 25 Posted January 25 Share Posted January 25 (edited) Hi @mLipok, that's funny 😁 , because I also do have this page https://demoqa.com/ in my favorites to share some demos to team members at work for educational purposes of how to automated different web elements. I will add your suggested page too, thanks. Quote It can be handy for developing examples, practice, and solving problems. I guess you think of using this page for the wd_demo.au3 examples? Absolutely. When I will have more time, I will come up with an pull request regarding this 😀 . Best regards Sven ________________Stay innovative! Edited January 25 by SOLVE-SMART Link to post Share on other sites
Danp2 1,230 Posted January 25 Author Share Posted January 25 28 minutes ago, SOLVE-SMART said: that's funny 😁 , because I also do have this page https://demoqa.com/ i I actually used that site earlier today -- https://github.com/Danp2/WebDriver/issues/151#issuecomment-1021305136 😃 WebDriver UDF [GH&S] Latest version Wiki FAQs Link to post Share on other sites
mLipok 1,303 Posted January 26 Share Posted January 26 On 1/2/2022 at 5:24 AM, mLipok said: So the main question is why such usage: _WD_PrintToPdf($sSession, '{"pageWidth": 29.70, "pageHeight": 42.00}') does not change the print parameters and thus the PDF file has incorrect page size. Any body know how to fix this ? I check deeply https://www.w3.org/TR/webdriver/#print-page And I found solution. Here is full full set of possible options as a JSON string: { "page":{ "width": 29.70 ,"height": 42.00 } ,"margin":{ "top": 2 ,"bottom": 2 ,"left": 2 ,"right": 2 } ,"scale": 0.5 ,"orientation":"landscape" ,"shrinkToFit": true ,"background": true ,"pageRanges": [1, "1-1"] } btw. Just now I'm working on examples for wd_demo.au3 and in next step an FAQ in Wiki. TheDcoder 1 Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2022-03-07 Link to post Share on other sites
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