Jump to content

Trying a WebDriver clean start but I could not


Recommended Posts

  • Developers
2 hours ago, MarcoMonte said:

I could not download chromedriver.exe unfortunately..

Why?

2 hours ago, MarcoMonte said:

I really could use some basic written steps to initiate.

The Wiki `describes the basic steps, so it would help why you have issues with the download step!

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

22 hours ago, Jos said:

Why?

The Wiki `describes the basic steps, so it would help why you have issues with the download step!

It's because my steps are shorter than anyone's else 😞 ... actually I have this Chrome version 124.0.6367.208 (Build ufficiale) (a 64 bit) and I cannot find the right match, Could it be this: https://storage.googleapis.com/chrome-for-testing-public/124.0.6367.207/win64/chrome-win64.zip ?

Link to comment
Share on other sites

Helloooo, here I am... again...

unfortunately I cannot validate the installation of Chromedriver... I took all the au3 files 

  • wd_Core.au3, wd_helper.au3 , wd_cdp.au3 , wd_capabilities.au3 from the WebDriver UDF
  • Json.au3 and BinaryCall.au3 from the JSON UDF
  • WinHttp.au3 and WinHttpConstants.au3 from the WinHttp UDF

and put them into the au3 files directory, than I downloaded Chromedriver 

"chromedriver    win64   https://storage.googleapis.com/chrome-for-testing-public/125.0.6422.60/win64/chromedriver-win64.zip"

and put it inside the same directory of wd_demo, clicking on wd_demo appear the gui, I select "chrome" from browser and go for "run" it comes a error "check logs", It creates a files called Chrome, reading that file I thought got a wrong webdriver but I cannot see others suitable webdriver for my browser, 

"Chrome è aggiornato
Versione 125.0.6422.61 (Build ufficiale) (a 64 bit)" <---- My browser
 
Here the logs I found after running wd_demo set on "Chrome"
[1716207842.173][INFO]: Starting ChromeDriver 111.0.5563.64 (c710e93d5b63b7095afe8c2c17df34408078439d-refs/branch-heads/5563@{#995}) on port 9515
[1716207842.173][INFO]: Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1716207843.944][INFO]: [37d3147aafd38edcab6334fdeb294b9b] COMMAND InitSession {
   "capabilities": {
      "alwaysMatch": {
         "goog:chromeOptions": {
            "excludeSwitches": [ "enable-automation" ],
            "w3c": true
         }
      }
   }
}
[1716207843.955][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
   }
}
[1716207843.956][INFO]: Populating Local State file: {
   "background_mode": {
      "enabled": false
   },
   "ssl": {
      "rev_checking": {
         "enabled": false
      }
   }
}
[1716207843.960][INFO]: Launching chrome: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-pre-commit-input --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\Marco\AppData\Local\Temp\scoped_dir9376_481513447" data:,
[1716207844.236][DEBUG]: DevTools HTTP Request: http://localhost:63839/json/version
[1716207844.580][DEBUG]: DevTools HTTP Response: {
   "Browser": "Chrome/125.0.6422.61",
   "Protocol-Version": "1.3",
   "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36",
   "V8-Version": "12.5.227.8",
   "WebKit-Version": "537.36 (@0e32b459e15a72d5ffe73ffa8a7d92c2f278e1ff)",
   "webSocketDebuggerUrl": "ws://localhost:63839/devtools/browser/02599d6c-198e-45da-bece-b00c78b607f5"
}

[1716207844.580][INFO]: Failed to connect to Chrome. Attempting to kill it.
[1716207844.682][INFO]: [37d3147aafd38edcab6334fdeb294b9b] RESPONSE InitSession ERROR session not created: This version of ChromeDriver only supports Chrome version 111
Current browser version is 125.0.6422.61 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[1716207844.683][DEBUG]: Log type 'driver' lost 0 entries on destruction
[1716207844.683][DEBUG]: Log type 'browser' lost 0 entries on destruction

 

The line: "RESPONSE InitSession ERROR session not created: This version of ChromeDriver only supports Chrome version 111
Current browser version is 125.0.6422.61 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" makes me think I am using an old version of Chromedriver but I am sure to use the new one... advises? 

Link to comment
Share on other sites

Hello guys, 

I am happy, started my first window with chrome at the wished page, but I noted It was not my usual page, I mean, I was not logged in google and furthermore the page kept asking me about cookies so I guess there is a way to pass google my account information right? Moreover, could I pilot a window already present, a page I opened before manually? 

Thanks guys.

Marco

Link to comment
Share on other sites

@MarcoMonte The example in the Wiki attaching to an existing Chrome session is kind of complex for nothing. What you need to do is to follow those 2 easy steps :

1. add the following parameter to your Chrome shortcut :  --remote-debugging-port=9222

2. use these capabilities in your script to create a session : '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "debuggerAddress": "localhost:9222"}}}}'

That will attach to your single current Chrome session. Rest of the script should remain the same.

Link to comment
Share on other sites

39 minutes ago, Nine said:

@MarcoMonte The example in the Wiki attaching to an existing Chrome session is kind of complex for nothing. What you need to do is to follow those 2 easy steps :

1. add the following parameter to your Chrome shortcut :  --remote-debugging-port=9222

2. use these capabilities in your script to create a session : '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "debuggerAddress": "localhost:9222"}}}}'

That will attach to your single current Chrome session. Rest of the script should remain the same.

Thx, I am pretty disheartened, I really miss native I.E. functions/instructions, I am not a programmer and this is hard enough for me, I just hate my job and I am trying to automate some tedious procedures.

Link to comment
Share on other sites

7 minutes ago, DennisFong222 said:

You're attempting a clean start of the WebDriver, but encountering difficulties. Ensure all processes related to the WebDriver are closed before trying again.

Grazie,

I had to reinstalled the total software on this old laptop, probably I had some old instance of webdriver hide somewhere, now it seems working properly just remain my limited skill to improve   

Link to comment
Share on other sites

Hello,

I am trying to log in Chrome with my credential, unfortunately "the code" creates a new one and actually it is even better but as I would not like writing just as a monkey I wish to learn something, currently I am reading this https://www.w3.org/TR/webdriver/#capabilities in the meanwhile someone could me explain me why it creates another account and not log in on mine? I am almost sure I should insert my credentials but How? that the code

 

 

Quote
Quote
#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
#Region
    ; specify driver, port and other options
    _WD_Option('Driver', 'chromedriver.exe')
    _WD_Option('Port', 9515)
    _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"')

    ; start the driver
    _WD_Startup()

    #cs
    ; create capabilites for session

    _WD_CapabilitiesStartup()
    _WD_CapabilitiesAdd('alwaysMatch', 'chrome')
    _WD_CapabilitiesAdd('w3c', True)
    _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation')
    Local $sCapabilities = _WD_CapabilitiesGet()    
    #ce
Local $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"]}}}}'
    ; create session with given Capabilities
    Global $WD_SESSION = _WD_CreateSession($sDesiredCapabilities)


    #EndRegion ; initialize webdriver sesion

; navigate to some website
    Global $sURL = 'https://www.comune.roma.it/'
    _WD_Navigate($WD_SESSION, $sURL)
    _WD_LoadWait($WD_SESSION, 10000)
    ; wait for loading process ends

 

 

 

Link to comment
Share on other sites

From the webdriver specs that you linked to above --

Quote

It is advisable that remote ends create a new profile when creating a new session. This prevents potentially sensitive session data from being accessible to new sessions, ensuring both privacy and preventing state from bleeding through to the next session.

See the FAQ section in the wiki for an example of how to use a user defined profile.

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...