MarcoMonte Posted March 17, 2023 Share Posted March 17, 2023 Hello, I am coming back on autoit because I need to automatize some routins my job requires, I use web applications on Chrome and finding hard to use not native functions on autoit for this pourpose I quit from trying automation. I would like to ask you if there is now a way to create automation on Chrome in a easier way. Thanks guys Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted March 17, 2023 Share Posted March 17, 2023 (edited) Hi @MarcoMonte, this totally depends on you, your experience and your interest which way do you want and prefer. I personal would say, in case of AutoIt you should go with au3WebDriver (WebDriver) for browser automation. See this related post of mine. You could also go with IUIAutomation for browser automation. You could even use other common frameworks that are not related to AutoIt, like Selenium, Playwright, WebdriverIO and so one. 13 minutes ago, MarcoMonte said: I would like to ask you if there is now a way to create automation on Chrome in a easier way. What is the "easier way" for you? Tell us a bit more about your experience etc., then the suggestions would be more precise 🤝 . Best regards Sven Edited March 17, 2023 by SOLVE-SMART MarcoMonte 1 Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon) Link to comment Share on other sites More sharing options...
MarcoMonte Posted March 17, 2023 Author Share Posted March 17, 2023 Hi, thanks for the advice, I had a look and it seems really cool, I'll try this method, I thank you for your time Marco SOLVE-SMART 1 Link to comment Share on other sites More sharing options...
MarcoMonte Posted March 21, 2023 Author Share Posted March 21, 2023 Hi! I am trying to move my first steps with WebDriver to automate some tedious repetitive tasks in my jobs and I encountered a problem I can't solve, I handled the installation correctly because the wd_demo works fine, but when I run this simple code: #Region - include files ; standard UDF's #include <ButtonConstants.au3> #include <ColorConstants.au3> #include <Date.au3> #include <Debug.au3> #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; non standard UDF's #include "wd_helper.au3" #include "wd_capabilities.au3" #EndRegion - include files #Region VariabiliGlobali Global $AccessoFormale ="https://www.comune.roma.it" Global $Soluzione Global $Ufficio Global $Mail Global $Oggetto Global $Nome #EndRegion _WD_Startup() $sSession=_WD_CreateSession() _WD_Navigate($sSession, "https://www.comune.roma.it") I get this error: _WD_Startup ==> Invalid value [4] : Location for Web Driver not set. __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_CreateSession ==> Webdriver Exception [10] __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Navigate ==> Send / Recv error [6] : Parameters: URL= both file (wd_demo and my .au3 file) are in the same directory, why the first can see the webdriver location and the other one not? Is there a way to solve this issue? Link to comment Share on other sites More sharing options...
Nine Posted March 21, 2023 Share Posted March 21, 2023 You did not set Chrome. See demo -- lookfor Func SetupChrome. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
MarcoMonte Posted March 21, 2023 Author Share Posted March 21, 2023 I'll try, thx Link to comment Share on other sites More sharing options...
MarcoMonte Posted March 21, 2023 Author Share Posted March 21, 2023 I just can't start... I tried to set Chrome in this way: #Region - include files ; standard UDF's #include <ButtonConstants.au3> #include <ColorConstants.au3> #include <Date.au3> #include <Debug.au3> #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; non standard UDF's #include "wd_helper.au3" #include "wd_capabilities.au3" #EndRegion - include files #Region VariabiliGlobali ;~ Global $AccessoFormale ="https://www.comune.roma.it/GED/trasparenza/accessodocumentaleformale" Global $AccessoFormale ="https://www.comune.roma.it" Global $Soluzione Global $Ufficio Global $Mail Global $Oggetto Global $Nome Global $CoordinataTipo = 533 #EndRegion _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') ;~ Local $sCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"]}}}}' _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') $sSession=_WD_CreateSession() _WD_Navigate($sSession, "https://www.comune.roma.it") but I always get the same result: C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Marco\Desktop\aaaa\GK.au3" /UserParams +>17:11:53 Starting AutoIt3Wrapper (21.316.1639.1) from:SciTE.exe (4.4.6.0) Keyboard:00000410 OS:WIN_11/2009 CPU:X64 OS:X64 Environment(Language:0410) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\Marco\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\Marco\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.16.1) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\Marco\Desktop\aaaa\GK.au3 +>17:11:53 AU3Check ended.rc:0 >Running:(3.3.16.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Marco\Desktop\aaaa\GK.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. _WD_Option ==> Success [0] : Parameters: Option=Driver Value=chromedriver.exe _WD_Option ==> Success [0] : Parameters: Option=Port Value=9515 _WD_Option ==> Success [0] : Parameters: Option=DriverParams Value=--verbose --log-path="C:\Users\Marco\Desktop\aaaa\chrome.log" _WD_CapabilitiesAdd ==> Success [0] : Successfully used [alwaysMatch] with specified browser: chrome _WD_CapabilitiesAdd ==> Success [0] : Successfully added capability _WD_CapabilitiesAdd ==> Success [0] : Successfully added capability __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_CreateSession ==> Webdriver Exception [10] __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_Navigate ==> Send / Recv error [6] : Parameters: URL=https://www.comune.roma.it +>17:11:58 AutoIt3.exe ended.rc:0 +>17:11:58 AutoIt3Wrapper Finished. >Exit code: 0 Time: 5.83 Could pls someone shows me some code to start the web page? I am not lazy I am trying I swear... Link to comment Share on other sites More sharing options...
Danp2 Posted March 21, 2023 Share Posted March 21, 2023 The coding in wd_demo can be confusing because it needs to allow selection of multiple browsers, debug levels, etc. You need to add this line -- $sCapabilities = _WD_CapabilitiesGet() immediately before the call to _WD_CreateSession. And your _WD_CreateSession line needs to be update to include the capabilities string -- $sSession = _WD_CreateSession($sCapabilities) P.S. Please read the following link to learn how to properly post code on the forum Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
MarcoMonte Posted March 21, 2023 Author Share Posted March 21, 2023 Ok thx, I Will try it asap and of course I Will ha e a look at the way for posting code Link to comment Share on other sites More sharing options...
MarcoMonte Posted March 22, 2023 Author Share Posted March 22, 2023 Hello, unfortunately it doesn't work... I am losing hope 😞 I followed the advice but nothing happened that's my code expandcollapse popup#Region - include files ; standard UDF's #include <ButtonConstants.au3> #include <ColorConstants.au3> #include <Date.au3> #include <Debug.au3> #include <GuiComboBoxEx.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ; non standard UDF's #include "wd_helper.au3" #include "wd_capabilities.au3" #EndRegion - include files #Region VariabiliGlobali ;~ Global $AccessoFormale ="https://www.comune.roma.it/GED/trasparenza/accessodocumentaleformale" Global $AccessoFormale ="https://www.comune.roma.it" Global $Soluzione Global $Ufficio Global $Mail Global $Oggetto Global $Nome Global $CoordinataTipo = 533 #EndRegion _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') Local $sCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"]}}}}' _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') $sCapabilities = _WD_CapabilitiesGet() $sSession = _WD_CreateSession($sCapabilities) _WD_Navigate($sSession, "https://www.comune.roma.it") ;_WD_LoadWait(10000) and that's the error I get >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Marco\Desktop\aaaa\GK.au3" /UserParams +>10:06:48 Starting AutoIt3Wrapper (21.316.1639.1) from:SciTE.exe (4.4.6.0) Keyboard:00000410 OS:WIN_11/2009 CPU:X64 OS:X64 Environment(Language:0410) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\Marco\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\Marco\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.16.1) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\Marco\Desktop\aaaa\GK.au3 +>10:06:49 AU3Check ended.rc:0 >Running:(3.3.16.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Marco\Desktop\aaaa\GK.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. _WD_Option ==> Success [0] : Parameters: Option=Driver Value=chromedriver.exe _WD_Option ==> Success [0] : Parameters: Option=Port Value=9515 _WD_Option ==> Success [0] : Parameters: Option=DriverParams Value=--verbose --log-path="C:\Users\Marco\Desktop\aaaa\chrome.log" _WD_CapabilitiesAdd ==> Success [0] : Successfully used [alwaysMatch] with specified browser: chrome _WD_CapabilitiesAdd ==> Success [0] : Successfully added capability _WD_CapabilitiesAdd ==> Success [0] : Successfully added capability __WD_Post ==> Send / Recv error [6] : HTTP status = 0 _WD_CreateSession ==> Webdriver Exception [10] +>10:06:51 AutoIt3.exe ended.rc:0 +>10:06:51 AutoIt3Wrapper Finished. >Exit code: 0 Time: 3.68 some hoped advices? Link to comment Share on other sites More sharing options...
Solution Danp2 Posted March 22, 2023 Solution Share Posted March 22, 2023 You are missing this line, which should come after the section where you define the setup with _WD_Option -- _WD_Startup() Without this, the web driver is never launched so you can't create a session. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
MarcoMonte Posted March 22, 2023 Author Share Posted March 22, 2023 Ok, it does work now!!! Sorry for wasting your time. I really regret autoit native simple function on Internet Explorer... Really thank you again 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