Jump to content

Recommended Posts

Posted (edited)
...
Func _CDP_Browser_FullPath($sFullPath = Default)
    Local Static $sBrowser = "init", $iErr = 10, $iExt = 10
    If $sBrowser = "init" Or $sFullPath = "init" Then
        $iErr = 10
        $iExt = 1
        $sBrowser = @ProgramFilesDir & "\Google\Chrome\Application\chrome.exe"
        If Not FileGetSize($sBrowser) Then $sBrowser = @LocalAppDataDir & "\Google\Chrome\Application\chrome.exe"
        If Not FileGetSize($sBrowser) Then $sBrowser = ""
    EndIf
    If Not IsKeyword($sFullPath) And $sFullPath <> "" And $sFullPath <> "init" Then
        $iErr = 10
        $iExt = 2
        $sBrowser = $sFullPath
    EndIf
    If $iErr = 10 Then $iErr = Int(Not FileGetSize($sBrowser))
    Return SetError($iErr, $iExt, $sBrowser)
EndFunc   ;==>_CDP_Browser_FullPath


#Region --- Browser Class ---

Func _CDP_Browser_Launch($oSelf, $browser = Default, $port = Default, $startupSwitches = Default, $profile = Default, $windowSize = Default)

    If $cdp.config.infoPopups = True Then SplashTextOn("AutoIt CDP", "Preparing browser ...", 420, 120)

    If $browser = Default Then
        $browser = _CDP_Browser_FullPath($browser)
    EndIf
...

Thanks for sharing.

Edited by argumentum
better

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting  image.gif.922e3a93535f431de08b31ee669cc446.gif
autoit_scripter_blue_userbar.png

Posted

Thanks.

But this means next one to add to my Browser.au3 UDF

Oh boy.

;)

 

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 * How to ask ChatGPT for AutoIt Codefor 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 APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

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 TaskSchedulerIE 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 stuffOnHungApp handlerAvoid "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"
:naughty:  :ranting:, 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: 2023-04-24

  • seangriffin changed the title to [UDF] AutoIt CDP UDF — A Modern, Playwright‑Style Chrome Automation Library
  • 2 weeks later...
Posted (edited)

Thank you for sharing!

Edited by subtlelonging
Withdraw the post due to a serious bug. Wait for it to be fixed and improved before republishing it.
  • 2 weeks later...
Posted (edited)

📢UDF Update — New HTTP API Support (GET, POST, DELETE)

Hi everyone,

I’m excited to share a new feature update for the CDP UDF: built‑in HTTP API support for GET, POST, and DELETE requests.

This makes it much easier to integrate REST API testing directly into your CDP automation workflows. The API layer is lightweight, uses the JsonC UDF for request/response handling, and keeps your scripts clean and expressive.

Three new example scripts are included (Github link in the top post):

  • Example API GET.au3

  • Example API POST.au3

  • Example API DELETE.au3

Below are the same examples inlined for quick reference.

HTTP GET Example

$jHeaderData = _JsonC_Object().add("Accept", "application/json")
$jResp = $api.get('https://apichallenges.eviltester.com/simpleapi/items', $jHeaderData)

HTTP DELETE Example

$jResp = $api.delete("https://apichallenges.eviltester.com/simpleapi/items/" & $firstId)

HTTP POST Example

$jPostData = _JsonC_Object().add("type", "blu-ray").add("isbn13", $isbn).add("price", 97.99).add("numberinstock", 0)
$jHeaderData = _JsonC_Object().add("Content-Type", "application/json")
$jResp = $api.post('https://apichallenges.eviltester.com/simpleapi/items', $jPostData, $jHeaderData)

 

Edited by seangriffin

Cheers, Sean.

See my other UDFs:

Chrome UDF - Automate Chrome | SAP UDF - Automate SAP | Java UDF - Automate Java Applications & Applets | Tesseract (OCR) UDF - Capture text from applications, controls and the desktop | Textract (OCR) UDF - Capture text from applications and controls | FileSystemMonitor UDF - File, Folder, Drive and Shell Monitoring | VLC (Media Player) UDF - Creating and controlling a VLC control in AutoIT | Google Maps UDF - Creating and controlling Google Maps (inc. GE) in AutoIT | SAPIListBox (Speech Recognition) UDF - Speech Recognition via the Microsoft Speech (SAPI) ListBox | eBay UDF - Automate eBay using the eBay API | ChildProc (Parallel Processing) UDF - Parallel processing functions for AutoIT | HyperCam (Screen Recording) UDF - Automate the HyperCam screen recorder | Twitter UDF - Automate Twitter using OAuth and the Twitter API | cURL UDF - a UDF for transferring data with URL syntax

See my other Tools:

Rapid Menu Writer - Add menus to DVDs in seconds | TV Player - Automates the process of playing videos on an external TV / Monitor | Rapid Video Converter - A tool for resizing and reformatting videos | [topic130531]Rapid DVD Creator - Convert videos to DVD fast and for free | ZapPF - A tool for killing processes and recycling files | Sean's eBay Bargain Hunter - Find last minute bargains in eBay using AutoIT | Sean's GUI Inspector - A scripting tool for querying GUIs | TransLink Journey Planner with maps - Incorporating Google Maps into an Australian Journey Planner | Automate Qt and QWidgets | Brisbane City Council Event Viewer - See what's going on in Brisbane, Australia
  • 2 weeks later...
Posted

Hello,

I tested the following simple script for automatic login. It works perfectly, but when I try to compile it, I get an error message.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include "CDP.au3"

$chrome = $browser.launch(Default, 9299, Default, Default)

$page = $chrome.newPage()

$page.goto("https://autoit.de/wcf/login/")

$page.locator("//*[@id='username']").sendKeys("Username")
Sleep(1000)
$page.locator("//*[@id='password']").sendKeys("Password")
Sleep(1000)
$page.locator("//*[@id='submitButton']").click()

Error:

Aut2exe.exe encountered an error ended with error:   Error adding file:  .\json-c.dll .rc:2

Aut2exe.exe encountered an error ended with error: Error adding file: .\selenium-manager.exe .rc:2

 

Have anyone an idea?

KR,

gmmg

 

Posted
47 minutes ago, gmmg said:

Hello,

I tested the following simple script for automatic login. It works perfectly, but when I try to compile it, I get an error message.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

#include "CDP.au3"

$chrome = $browser.launch(Default, 9299, Default, Default)

$page = $chrome.newPage()

$page.goto("https://autoit.de/wcf/login/")

$page.locator("//*[@id='username']").sendKeys("Username")
Sleep(1000)
$page.locator("//*[@id='password']").sendKeys("Password")
Sleep(1000)
$page.locator("//*[@id='submitButton']").click()

Error:

Aut2exe.exe encountered an error ended with error:   Error adding file:  .\json-c.dll .rc:2

Aut2exe.exe encountered an error ended with error: Error adding file: .\selenium-manager.exe .rc:2

 

Have anyone an idea?

KR,

gmmg

 

Ohhh great pickup thanks!

I recently embedded the json-c.dll directly inside the JsonC.au3 so json-c.dll isn't required anymore.  But I forgot to remove it from the FileInstall command at the top of the UDF ...

#AutoIt3Wrapper_UseX64=y
FileInstall(".\json-c.dll", ".\")
FileInstall(".\libcurl-x64.dll", ".\")
FileInstall(".\selenium-manager.exe", ".\")

Nice pickup.  I have made this fix to CDP.au3 and uploaded to Github.

>Running:(3.3.18.0):C:\Program Files (x86)\AutoIt3\aut2exe\aut2exe.exe  /in "C:\dwn\autoit-cdp-udf\temp_example.au3" /out "C:\Users\SGriffin\AppData\Local\AutoIt v3\Aut2exe\~AU6DF5.tmp.exe" /nopack /comp 2 /Console /x64
+>21:37:17 Aut2exe.exe ended.C:\Users\SGriffin\AppData\Local\AutoIt v3\Aut2exe\~AU6DF5.tmp.exe. rc:0
+>21:37:17 Created program:C:\dwn\autoit-cdp-udf\temp_example.exe
+>21:37:18 AutoIt3Wrapper Finished.

Doh!  I forgot to upload selenium-manager.exe to Github 😔  Sorry.  Have uploaded it now.  Your next download should work.

Thanks for the update!

Cheers, Sean.

See my other UDFs:

Chrome UDF - Automate Chrome | SAP UDF - Automate SAP | Java UDF - Automate Java Applications & Applets | Tesseract (OCR) UDF - Capture text from applications, controls and the desktop | Textract (OCR) UDF - Capture text from applications and controls | FileSystemMonitor UDF - File, Folder, Drive and Shell Monitoring | VLC (Media Player) UDF - Creating and controlling a VLC control in AutoIT | Google Maps UDF - Creating and controlling Google Maps (inc. GE) in AutoIT | SAPIListBox (Speech Recognition) UDF - Speech Recognition via the Microsoft Speech (SAPI) ListBox | eBay UDF - Automate eBay using the eBay API | ChildProc (Parallel Processing) UDF - Parallel processing functions for AutoIT | HyperCam (Screen Recording) UDF - Automate the HyperCam screen recorder | Twitter UDF - Automate Twitter using OAuth and the Twitter API | cURL UDF - a UDF for transferring data with URL syntax

See my other Tools:

Rapid Menu Writer - Add menus to DVDs in seconds | TV Player - Automates the process of playing videos on an external TV / Monitor | Rapid Video Converter - A tool for resizing and reformatting videos | [topic130531]Rapid DVD Creator - Convert videos to DVD fast and for free | ZapPF - A tool for killing processes and recycling files | Sean's eBay Bargain Hunter - Find last minute bargains in eBay using AutoIT | Sean's GUI Inspector - A scripting tool for querying GUIs | TransLink Journey Planner with maps - Incorporating Google Maps into an Australian Journey Planner | Automate Qt and QWidgets | Brisbane City Council Event Viewer - See what's going on in Brisbane, Australia
Posted (edited)

Thank You. It works :)

Where can I specify, that the chromedriver download path, is the same as the script path?

I found the settings for the selenium-manager.exe

selenium-manager.exe --browser chrome --cache-path c:\my_path 

How could I specify scriptdir?

KR, gmmg

Edited by gmmg
Posted

 

for my Website automation test: i think, i only need the curl-ca-bundle.crt + libcurl-x64.dll.

FileInstall(".\curl-ca-bundle.crt", ".\")
FileInstall(".\libcurl-x64.dll", ".\")
;FileInstall(".\selenium-manager.exe", ".\")
;FileInstall(".\sqlite3_x64.dll", ".\")
;FileInstall(".\sqlite3.exe", ".\")

Could it be that I don't need the WebDriver?
 
Posted (edited)
39 minutes ago, gmmg said:

 

for my Website automation test: i think, i only need the curl-ca-bundle.crt + libcurl-x64.dll.

FileInstall(".\curl-ca-bundle.crt", ".\")
FileInstall(".\libcurl-x64.dll", ".\")
;FileInstall(".\selenium-manager.exe", ".\")
;FileInstall(".\sqlite3_x64.dll", ".\")
;FileInstall(".\sqlite3.exe", ".\")

Could it be that I don't need the WebDriver?
 

If the only features you use in this UDF are chrome automation features then the only FileInstall that should be required is libcurl-x64.dll.

If you use any of the API features and security related functions in those features like SSL then you may additionally need FileInstall for curl-ca-bundle.crt.

FileInstall for selenium-manager.exe is only required if you use that feature in the launch method for a browser.

FileInstall for sqlite3.exe and sqlite3_x64.dll is for an upcoming feature named "Enterprise Mode" which takes the UDF into features beyond that of Playwright, such as test data management.

This UDF does not use or require WebDriver at all.

Edited by seangriffin

Cheers, Sean.

See my other UDFs:

Chrome UDF - Automate Chrome | SAP UDF - Automate SAP | Java UDF - Automate Java Applications & Applets | Tesseract (OCR) UDF - Capture text from applications, controls and the desktop | Textract (OCR) UDF - Capture text from applications and controls | FileSystemMonitor UDF - File, Folder, Drive and Shell Monitoring | VLC (Media Player) UDF - Creating and controlling a VLC control in AutoIT | Google Maps UDF - Creating and controlling Google Maps (inc. GE) in AutoIT | SAPIListBox (Speech Recognition) UDF - Speech Recognition via the Microsoft Speech (SAPI) ListBox | eBay UDF - Automate eBay using the eBay API | ChildProc (Parallel Processing) UDF - Parallel processing functions for AutoIT | HyperCam (Screen Recording) UDF - Automate the HyperCam screen recorder | Twitter UDF - Automate Twitter using OAuth and the Twitter API | cURL UDF - a UDF for transferring data with URL syntax

See my other Tools:

Rapid Menu Writer - Add menus to DVDs in seconds | TV Player - Automates the process of playing videos on an external TV / Monitor | Rapid Video Converter - A tool for resizing and reformatting videos | [topic130531]Rapid DVD Creator - Convert videos to DVD fast and for free | ZapPF - A tool for killing processes and recycling files | Sean's eBay Bargain Hunter - Find last minute bargains in eBay using AutoIT | Sean's GUI Inspector - A scripting tool for querying GUIs | TransLink Journey Planner with maps - Incorporating Google Maps into an Australian Journey Planner | Automate Qt and QWidgets | Brisbane City Council Event Viewer - See what's going on in Brisbane, Australia
Posted (edited)
1 hour ago, gmmg said:

Thank You. It works :)

Where can I specify, that the chromedriver download path, is the same as the script path?

I found the settings for the selenium-manager.exe

selenium-manager.exe --browser chrome --cache-path c:\my_path 

How could I specify scriptdir?

KR, gmmg

This UDF does not use or require a WebDriver (meaning chromedriver for Chrome)

Edited by seangriffin

Cheers, Sean.

See my other UDFs:

Chrome UDF - Automate Chrome | SAP UDF - Automate SAP | Java UDF - Automate Java Applications & Applets | Tesseract (OCR) UDF - Capture text from applications, controls and the desktop | Textract (OCR) UDF - Capture text from applications and controls | FileSystemMonitor UDF - File, Folder, Drive and Shell Monitoring | VLC (Media Player) UDF - Creating and controlling a VLC control in AutoIT | Google Maps UDF - Creating and controlling Google Maps (inc. GE) in AutoIT | SAPIListBox (Speech Recognition) UDF - Speech Recognition via the Microsoft Speech (SAPI) ListBox | eBay UDF - Automate eBay using the eBay API | ChildProc (Parallel Processing) UDF - Parallel processing functions for AutoIT | HyperCam (Screen Recording) UDF - Automate the HyperCam screen recorder | Twitter UDF - Automate Twitter using OAuth and the Twitter API | cURL UDF - a UDF for transferring data with URL syntax

See my other Tools:

Rapid Menu Writer - Add menus to DVDs in seconds | TV Player - Automates the process of playing videos on an external TV / Monitor | Rapid Video Converter - A tool for resizing and reformatting videos | [topic130531]Rapid DVD Creator - Convert videos to DVD fast and for free | ZapPF - A tool for killing processes and recycling files | Sean's eBay Bargain Hunter - Find last minute bargains in eBay using AutoIT | Sean's GUI Inspector - A scripting tool for querying GUIs | TransLink Journey Planner with maps - Incorporating Google Maps into an Australian Journey Planner | Automate Qt and QWidgets | Brisbane City Council Event Viewer - See what's going on in Brisbane, Australia
Posted

In my Script, i must set the lauch parameter for the chromeprofile path, because otherwise it won't start from a network path

$chrome = $browser.launch(Default, 9299, Default, @TempDir & "\chromeprofile")

 

Posted (edited)
50 minutes ago, gmmg said:

In my Script, i must set the lauch parameter for the chromeprofile path, because otherwise it won't start from a network path

$chrome = $browser.launch(Default, 9299, Default, @TempDir & "\chromeprofile")

 

Not sure what your question is.  Do you want to start chrome from a network path?  I've never attempted that. 

You can try changing the first parameter of the $browser.launch method (in your example Default) to an alternate path for chrome itself (chrome.exe).  By default modern chrome instances reside in @ProgramFilesDir & "\Google\Chrome\Application\chrome.exe" and that's what Default currently refers to.

I have been meaning to publish a very simple example on the usage of the UDF.  I took your example and reduced it to a bare-minimal form that works (with no parameters for launch) ...

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include "CDP.au3"

$chrome = $browser.launch()
$page = $chrome.newPage()
$page.goto("https://autoit.de/wcf/login/")
$page.locator("//*[@id='username']").sendKeys("Username")
$page.locator("//*[@id='password']").sendKeys("Password")
$page.locator("//*[@id='submitButton']").click()

 

Edited by seangriffin

Cheers, Sean.

See my other UDFs:

Chrome UDF - Automate Chrome | SAP UDF - Automate SAP | Java UDF - Automate Java Applications & Applets | Tesseract (OCR) UDF - Capture text from applications, controls and the desktop | Textract (OCR) UDF - Capture text from applications and controls | FileSystemMonitor UDF - File, Folder, Drive and Shell Monitoring | VLC (Media Player) UDF - Creating and controlling a VLC control in AutoIT | Google Maps UDF - Creating and controlling Google Maps (inc. GE) in AutoIT | SAPIListBox (Speech Recognition) UDF - Speech Recognition via the Microsoft Speech (SAPI) ListBox | eBay UDF - Automate eBay using the eBay API | ChildProc (Parallel Processing) UDF - Parallel processing functions for AutoIT | HyperCam (Screen Recording) UDF - Automate the HyperCam screen recorder | Twitter UDF - Automate Twitter using OAuth and the Twitter API | cURL UDF - a UDF for transferring data with URL syntax

See my other Tools:

Rapid Menu Writer - Add menus to DVDs in seconds | TV Player - Automates the process of playing videos on an external TV / Monitor | Rapid Video Converter - A tool for resizing and reformatting videos | [topic130531]Rapid DVD Creator - Convert videos to DVD fast and for free | ZapPF - A tool for killing processes and recycling files | Sean's eBay Bargain Hunter - Find last minute bargains in eBay using AutoIT | Sean's GUI Inspector - A scripting tool for querying GUIs | TransLink Journey Planner with maps - Incorporating Google Maps into an Australian Journey Planner | Automate Qt and QWidgets | Brisbane City Council Event Viewer - See what's going on in Brisbane, Australia
Posted
2 minutes ago, seangriffin said:

By default modern chrome instances reside in @ProgramFilesDir & "\Google\Chrome\Application\chrome.exe" and that's what Default currently refers to.

...but if installed by "User mode" that needs the function I gave you in a prior post.

..and I ever seen network mode anything. It would be interesting test.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting  image.gif.922e3a93535f431de08b31ee669cc446.gif
autoit_scripter_blue_userbar.png

Posted (edited)

i must change the line $chrome = $browser.launch() to $chrome = $browser.launch(Default, 9299, Default, @TempDir & "\chromeprofile") , since I cannot ensure that a website logout has taken place

And the $FileDelete area for delete cookie settings. I haven't found any other solution for it yet.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include "CDP.au3"

;--delete Cookies--
Local $sProfile = @TempDir & "\chromeprofile"
FileDelete($sProfile & "\Default\Cookies")
FileDelete($sProfile & "\Default\Cookies-journal")
FileDelete($sProfile & "\Default\Network\Cookies")
FileDelete($sProfile & "\Default\Network\Cookies-journal")
FileDelete($sProfile & "\Cookies")
FileDelete($sProfile & "\Cookies-journal")

;$chrome = $browser.launch()
$chrome = $browser.launch(Default, 9299, Default, @TempDir & "\chromeprofile") 
$page = $chrome.newPage()
$page.goto("https://autoit.de/wcf/login/")
$page.locator("//*[@id='username']").sendKeys("Username")
$page.locator("//*[@id='password']").sendKeys("Password")
$page.locator("//*[@id='submitButton']").click()
Edited by gmmg
Posted
On 6/16/2026 at 10:47 PM, gmmg said:

i must change the line $chrome = $browser.launch() to $chrome = $browser.launch(Default, 9299, Default, @TempDir & "\chromeprofile") , since I cannot ensure that a website logout has taken place

And the $FileDelete area for delete cookie settings. I haven't found any other solution for it yet.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include "CDP.au3"

;--delete Cookies--
Local $sProfile = @TempDir & "\chromeprofile"
FileDelete($sProfile & "\Default\Cookies")
FileDelete($sProfile & "\Default\Cookies-journal")
FileDelete($sProfile & "\Default\Network\Cookies")
FileDelete($sProfile & "\Default\Network\Cookies-journal")
FileDelete($sProfile & "\Cookies")
FileDelete($sProfile & "\Cookies-journal")

;$chrome = $browser.launch()
$chrome = $browser.launch(Default, 9299, Default, @TempDir & "\chromeprofile") 
$page = $chrome.newPage()
$page.goto("https://autoit.de/wcf/login/")
$page.locator("//*[@id='username']").sendKeys("Username")
$page.locator("//*[@id='password']").sendKeys("Password")
$page.locator("//*[@id='submitButton']").click()

Management of cookies is an interesting concern.  I didn't want to mandate the UDF work one way or the other. 

In my own use cases of the UDF I need to support both options.  Either needing the browser to retain no knowledge of the web application in each run, or in situations where I need cookies and credentials to be retained between test runs but have no want or need to capture those in the script (perhaps for security or privacy reasons).

Thus I included the final parameter on the browser launch method - $clearCookies - so you can control this yourself.

Which provides the similar functions you are including in your script ...

if $clearCookies = True Then
    FileDelete($profile & "\Default\Cookies")
    FileDelete($profile & "\Default\Cookies-journal")
    FileDelete($profile & "\Default\Network\Cookies")
    FileDelete($profile & "\Default\Network\Cookies-journal")
EndIf

 

Cheers, Sean.

See my other UDFs:

Chrome UDF - Automate Chrome | SAP UDF - Automate SAP | Java UDF - Automate Java Applications & Applets | Tesseract (OCR) UDF - Capture text from applications, controls and the desktop | Textract (OCR) UDF - Capture text from applications and controls | FileSystemMonitor UDF - File, Folder, Drive and Shell Monitoring | VLC (Media Player) UDF - Creating and controlling a VLC control in AutoIT | Google Maps UDF - Creating and controlling Google Maps (inc. GE) in AutoIT | SAPIListBox (Speech Recognition) UDF - Speech Recognition via the Microsoft Speech (SAPI) ListBox | eBay UDF - Automate eBay using the eBay API | ChildProc (Parallel Processing) UDF - Parallel processing functions for AutoIT | HyperCam (Screen Recording) UDF - Automate the HyperCam screen recorder | Twitter UDF - Automate Twitter using OAuth and the Twitter API | cURL UDF - a UDF for transferring data with URL syntax

See my other Tools:

Rapid Menu Writer - Add menus to DVDs in seconds | TV Player - Automates the process of playing videos on an external TV / Monitor | Rapid Video Converter - A tool for resizing and reformatting videos | [topic130531]Rapid DVD Creator - Convert videos to DVD fast and for free | ZapPF - A tool for killing processes and recycling files | Sean's eBay Bargain Hunter - Find last minute bargains in eBay using AutoIT | Sean's GUI Inspector - A scripting tool for querying GUIs | TransLink Journey Planner with maps - Incorporating Google Maps into an Australian Journey Planner | Automate Qt and QWidgets | Brisbane City Council Event Viewer - See what's going on in Brisbane, Australia
Posted (edited)
On 6/16/2026 at 10:36 PM, argumentum said:

...but if installed by "User mode" that needs the function I gave you in a prior post.

..and I ever seen network mode anything. It would be interesting test.

Good point and sorry I didn't understand the context of your previous post.  Makes sense now.

Yes the UDF should expand on the many wonderous ways that browsers can be called via different installation paths.  😉

I didn't want to initially get bogged down in those details.  But work revisiting now its maturing.  Thanks

Edited by seangriffin

Cheers, Sean.

See my other UDFs:

Chrome UDF - Automate Chrome | SAP UDF - Automate SAP | Java UDF - Automate Java Applications & Applets | Tesseract (OCR) UDF - Capture text from applications, controls and the desktop | Textract (OCR) UDF - Capture text from applications and controls | FileSystemMonitor UDF - File, Folder, Drive and Shell Monitoring | VLC (Media Player) UDF - Creating and controlling a VLC control in AutoIT | Google Maps UDF - Creating and controlling Google Maps (inc. GE) in AutoIT | SAPIListBox (Speech Recognition) UDF - Speech Recognition via the Microsoft Speech (SAPI) ListBox | eBay UDF - Automate eBay using the eBay API | ChildProc (Parallel Processing) UDF - Parallel processing functions for AutoIT | HyperCam (Screen Recording) UDF - Automate the HyperCam screen recorder | Twitter UDF - Automate Twitter using OAuth and the Twitter API | cURL UDF - a UDF for transferring data with URL syntax

See my other Tools:

Rapid Menu Writer - Add menus to DVDs in seconds | TV Player - Automates the process of playing videos on an external TV / Monitor | Rapid Video Converter - A tool for resizing and reformatting videos | [topic130531]Rapid DVD Creator - Convert videos to DVD fast and for free | ZapPF - A tool for killing processes and recycling files | Sean's eBay Bargain Hunter - Find last minute bargains in eBay using AutoIT | Sean's GUI Inspector - A scripting tool for querying GUIs | TransLink Journey Planner with maps - Incorporating Google Maps into an Australian Journey Planner | Automate Qt and QWidgets | Brisbane City Council Event Viewer - See what's going on in Brisbane, Australia

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
×
×
  • Create New...