Jump to content

Is chromedriver the only way to manage chrome?


Go to solution Solved by Danp2,

Recommended Posts

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

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 by SOLVE-SMART

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

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

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

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

Link to comment
Share on other sites

Hello, 

unfortunately it doesn't work... I am losing hope 😞

I followed the advice but nothing happened

that's my 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/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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...