Jump to content

WebDriver UDF (W3C compliant version) - 06/04/2022


Recommended Posts

I have done some speed up in: _WD_ElementSelectAction() 
It is based on RegExp:

#include <Array.au3>

_Example()

Func _Example()
    Local $sHTML = _
            '<select id="OptionToChoose">' & @CRLF & _
            '   <option value="" selected="selected">Choose option</option>' & @CRLF & _
            '   <option value="1">Sun</option>' & @CRLF & _
            '   <option value="2">Earth</option>' & @CRLF & _
            '   <option value="3">Moon</option>' & @CRLF & _
            '</select>' & @CRLF & _
            ''

    Local $aOuter = StringRegExp($sHTML, '(?is)(<option value="(.*?)"( selected="selected"|.*?)>(.*?)</option>)', $STR_REGEXPARRAYGLOBALFULLMATCH)
    _ArrayDisplay($aOuter, '$aOuter')

    Local $aInner
    For $IDX_Out = 0 To UBound($aOuter) - 1
        $aInner = $aOuter[$IDX_Out]
        _ArrayDisplay($aInner, '$aInner = $aOuter[$IDX_Out] ... $IDX_Out = ' & $IDX_Out)
    Next

EndFunc   ;==>_Example

 

instead of using:

$sText = ""
                    For $sElement In $aOptions
                        $sJsonElement = '{"' & $_WD_ELEMENT_ID & '":"' & $sElement & '"}'
                        $sText &= (($sText <> "") ? @CRLF : "") & _WD_ExecuteScript($sSession, "return arguments[0].value + '|' + arguments[0].label", $sJsonElement, Default, "[value]")
                        $iErr = @error
                    Next


I have <select> with 351 options  and In my test it is a great speed up about 100x faster !

As so far need some more testing.

btw.
The example with RegExp was submited to SVN and will be available in future AutoIt HelpFile release.

Edited by mLipok

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 APIErrorLog.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 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: 2022-03-07

Link to post
Share on other sites
  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Introduction This UDF will allow you to interact with any browser that supports the W3C WebDriver specifications. Supporting multiple browsers via the same code base is now possible with just a f

Latest update just released. See below for change log.  

Latest update just released. See below for change log.  

Posted Images

On 12/31/2021 at 10:03 PM, Danp2 said:

IDK without more details. Is this occurring with _WD_CreateSession? What data is being returned from Chromedriver to __WD_Post?

I had the same issue today and here are my logs:
 

Quote

Starting ChromeDriver 96.0.4664.45 (76e4c1bb2ab4671b8beba3444e61c0f17584b2fc-refs/branch-heads/4664@{#947}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.

DevTools listening on ws://127.0.0.1:65418/devtools/browser/65ebc307-dd7a-426a-adba-33f276b991ea
[0103/163746.485:ERROR:cache_util_win.cc(20)] Unable to move the cache: Odmowa dostŕpu. (0x5)
[0103/163746.486:ERROR:cache_util.cc(144)] Unable to move cache folder C:\Users\Szef\AppData\Local\Google\Chrome\User Data\Default\Default\GPUCache to C:\Users\Szef\AppData\Local\Google\Chrome\User Data\Default\Default\old_GPUCache_000
[0103/163746.486:ERROR:disk_cache.cc(185)] Unable to create cache
[0103/163746.486:ERROR:shader_disk_cache.cc(612)] Shader Cache Creation failed: -2
[0103/163746.784:ERROR:command_buffer_proxy_impl.cc(125)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[0103/163748.512:ERROR:cache_util_win.cc(20)] Unable to move the cache: Odmowa dostŕpu. (0x5)
[0103/163748.513:ERROR:cache_util.cc(144)] Unable to move cache folder C:\Users\Szef\AppData\Local\Google\Chrome\User Data\Default\Default\Cache to C:\Users\Szef\AppData\Local\Google\Chrome\User Data\Default\Default\old_Cache_000
[0103/163748.514:ERROR:disk_cache.cc(185)] Unable to create cache
[0103/163749.501:ERROR:service_worker_storage.cc(1899)] Failed to delete the database: Database IO error
[0103/163752.545:ERROR:cache_util_win.cc(20)] Unable to move the cache: Odmowa dostŕpu. (0x5)
[0103/163752.545:ERROR:cache_util.cc(144)] Unable to move cache folder C:\Users\Szef\AppData\Local\Google\Chrome\User Data\Default\Default\GPUCache to C:\Users\Szef\AppData\Local\Google\Chrome\User Data\Default\Default\old_GPUCache_000
[0103/163752.546:ERROR:disk_cache.cc(185)] Unable to create cache
[0103/163752.546:ERROR:shader_disk_cache.cc(612)] Shader Cache Creation failed: -2
[0103/163752.804:INFO:CONSOLE(427)] "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu", source: https://przegladarka*****.pl/TSPD/08c5699bd4ab2000b1bfa704560d2c9b53582c7ceb44ecaa92a4eb737e6cb3fb321cbaf05f0bd06a?type=11 (427)
[0103/163752.805:INFO:CONSOLE(427)] "The ScriptProcessorNode is deprecated. Use AudioWorkletNode instead. (https://bit.ly/audio-worklet)", source: https://przegladarka*****.pl/TSPD/08c5699bd4ab2000b1bfa704560d2c9b53582c7ceb44ecaa92a4eb737e6cb3fb321cbaf05f0bd06a?type=11 (427)
[0103/163752.807:INFO:CONSOLE(430)] "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu", source: https://przegladarka*****.pl/TSPD/08c5699bd4ab2000b1bfa704560d2c9b53582c7ceb44ecaa92a4eb737e6cb3fb321cbaf05f0bd06a?type=11 (430)
[0103/163752.807:INFO:CONSOLE(433)] "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu", source: https://przegladarka*****.pl/TSPD/08c5699bd4ab2000b1bfa704560d2c9b53582c7ceb44ecaa92a4eb737e6cb3fb321cbaf05f0bd06a?type=11 (433)
[0103/163752.808:ERROR:web_contents_delegate.cc(228)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
[0103/163752.808:ERROR:web_contents_delegate.cc(228)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
[0103/163752.837:ERROR:gl_utils.cc(318)] [.WebGL-000031DC0007FF00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[0103/163752.982:ERROR:gl_utils.cc(318)] [.WebGL-000031DC0007FF00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[0103/163753.079:ERROR:gl_utils.cc(318)] [.WebGL-000031DC0007FF00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[0103/163753.173:INFO:CONSOLE(0)] "[.WebGL-000031DC0007FF00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels", source: https://przegladarka*****.pl/TSPD/?type=20 (0)
[0103/163753.174:INFO:CONSOLE(0)] "[.WebGL-000031DC0007FF00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels", source: https://przegladarka*****.pl/TSPD/?type=20 (0)
[0103/163753.175:INFO:CONSOLE(0)] "[.WebGL-000031DC0007FF00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels", source: https://przegladarka*****.pl/TSPD/?type=20 (0)
[0103/163753.607:ERROR:database.cc(1773)] Quota SQLite error: code 5 errno 33: database is locked sql: PRAGMA auto_vacuum
[0103/163753.639:ERROR:database.cc(1773)] Quota SQLite error: code 5 errno 33: database is locked sql: PRAGMA journal_mode=TRUNCATE
[0103/163755.193:ERROR:sandbox_origin_database.cc(190)] SandboxOriginDatabase failed at: Init@storage/browser/file_system/sandbox_origin_database.cc:94 with error: IO error: C:\Users\Szef\AppData\Local\Google\Chrome\User Data\Default\Default\File System\Origins/LOCK: File currently in use. (ChromeMethodBFE: 15::LockFile::2)
[0103/163755.194:WARNING:sandbox_origin_database.cc(106)] Attempting to repair SandboxOriginDatabase.
[0103/163755.439:ERROR:database.cc(1773)] Quota SQLite error: code 5 errno 33: database is locked sql: PRAGMA cache_size=500
[0103/163755.470:ERROR:database.cc(1773)] Quota SQLite error: code 5 errno 33: database is locked sql: SELECT 1 FROM sqlite_schema WHERE type=? AND name=?
[0103/163755.500:ERROR:database.cc(1773)] Quota SQLite error: code 5 errno 33: database is locked sql: SELECT 1 FROM sqlite_schema WHERE type=? AND name=?
[0103/163755.531:ERROR:database.cc(1773)] Quota SQLite error: code 5 errno 33: database is locked sql: SELECT 1 FROM sqlite_schema WHERE type=? AND name=?
[0103/163755.562:ERROR:database.cc(1773)] Quota SQLite error: code 5 errno 33: database is locked sql: CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR)
[0103/163755.562:ERROR:quota_database.cc(747)] Could not open the quota database, resetting.
[0103/163758.480:ERROR:quota_database.cc(749)] Failed to reset the quota database.
[0103/163759.241:WARNING:sandbox_origin_database.cc(140)] Failed to repair SandboxOriginDatabase.
[0103/163801.248:ERROR:sandbox_origin_database.cc(190)] SandboxOriginDatabase failed at: Init@storage/browser/file_system/sandbox_origin_database.cc:94 with error: IO error: C:\Users\Szef\AppData\Local\Google\Chrome\User Data\Default\Default\File System\Origins/LOCK: File currently in use. (ChromeMethodBFE: 15::LockFile::2)
[0103/163801.248:WARNING:sandbox_origin_database.cc(106)] Attempting to repair SandboxOriginDatabase.
[0103/163805.309:WARNING:sandbox_origin_database.cc(140)] Failed to repair SandboxOriginDatabase.
[0103/163807.328:ERROR:sandbox_origin_database.cc(190)] SandboxOriginDatabase failed at: Init@storage/browser/file_system/sandbox_origin_database.cc:94 with error: IO error: C:\Users\Szef\AppData\Local\Google\Chrome\User Data\Default\Default\File System\Origins/LOCK: File currently in use. (ChromeMethodBFE: 15::LockFile::2)
[0103/163807.329:WARNING:sandbox_origin_database.cc(106)] Attempting to repair SandboxOriginDatabase.
[0103/163811.379:WARNING:sandbox_origin_database.cc(140)] Failed to repair SandboxOriginDatabase.
[0103/163813.393:ERROR:sandbox_origin_database.cc(190)] SandboxOriginDatabase failed at: Init@storage/browser/file_system/sandbox_origin_database.cc:94 with error: IO error: C:\Users\Szef\AppData\Local\Google\Chrome\User Data\Default\Default\File System\Origins/LOCK: File currently in use. (ChromeMethodBFE: 15::LockFile::2)
[0103/163813.393:WARNING:sandbox_origin_database.cc(106)] Attempting to repair SandboxOriginDatabase.
[0103/163817.439:WARNING:sandbox_origin_database.cc(140)] Failed to repair SandboxOriginDatabase.
 

Also, I noticed that there were a lot of open GoogleChrome instances left in the background.

btw.
"Odmowa dostŕpu"  should "Odmowa dostępu" and this mean "Access denied"

Edited by mLipok

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 APIErrorLog.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 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: 2022-03-07

Link to post
Share on other sites
Posted (edited)
4 hours ago, mLipok said:

I had the same issue today and here are my logs:

Thanks, but I really wanted to see the contents of the Scite output panel so that I can see what details are being returned by Chromedriver to the calling program.

Quote

Also, I noticed that there were a lot of open GoogleChrome instances left in the background.

Were those opened prior to running your script? That might explain the issue if you are using an existing profile.

Edited by Danp2
Link to post
Share on other sites
6 hours ago, mLipok said:

I have done some speed up in: _WD_ElementSelectAction() 
It is based on RegExp:

Nice trick, but we also need to keep the current version as it is more robust, the RegEx might fail in edge cases, there's a saying about using RegEx with HTML ;)

I would implement this with a flag to choose the method, and in my opinion the default should be the original method because it's accurate and has less chance of failing. If someone wants speed they can set $bFast = True to use the RegEx method :D

Edited by TheDcoder

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to post
Share on other sites
1 hour ago, Danp2 said:

Were those opened prior to running your script? That might explain the issue if you are using an existing profile.

I use:

_WD_CapabilitiesAdd('args', 'user-data-dir', 'C:\Users\' & @UserName & '\AppData\Local\Google\Chrome\User Data\Default')
_WD_CapabilitiesAdd('args', '--profile-directory', Default)

But it usually works fine.

It usually had issues when I manually stopped the script and then killed the ChromeDriver.exe process.

Edited by mLipok

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 APIErrorLog.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 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: 2022-03-07

Link to post
Share on other sites
9 minutes ago, mLipok said:

But it usually works fine.

It's a bad idea to use your global default profile with WD >_<

There are several reasons but the main one being that there would be conflicts, Chrome is not designed to use the same profile and share it with other independent instances.

The best alternative I can think of is to simply make a copy of the profile you want and use that instead.

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to post
Share on other sites
20 hours ago, mLipok said:

</option>

Did you forget to escape the backslash in your RegEx? regex101 says it's an error
Edit: And it's broken if selected comes before the value
Edit2: Per the HTML Standard (?) a closing </option> tag isn't even required :D

13 hours ago, TheDcoder said:

best

I'd disagree without defining best. Your solution is the fast and easy, while not relying on a profile is probably better practice ;)

Edited by seadoggie01

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager

Link to post
Share on other sites
1 hour ago, seadoggie01 said:

Your solution is the fast and easy, while not relying on a profile is probably better practice

What you mean saying "while not relying on a profile is probably better practice" ?

 

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 APIErrorLog.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 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: 2022-03-07

Link to post
Share on other sites

Mostly I mean that all of the "stuff" that comes with a profile can't be relied upon to always be there. Because I use AutoIt primarily at work, I've needed to learn how to write my scripts so others can use them. So if I use the current users' profile, I can't assume anything will be there, because there's a chance they don't have the same (as a terrible example) bookmarks as me

Of course, this is less important if you're developing only for yourself, but you still might run into issues if you switch computers, upgrade to Win11, etc.

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager

Link to post
Share on other sites
4 hours ago, seadoggie01 said:

Did you forget to escape the backslash in your RegEx? regex101 says it's an error

I was not aware so far because it works ...... so far.
Tested, fixed, thanks.

 

4 hours ago, seadoggie01 said:

Edit: And it's broken if selected comes before the value

Working on.

4 hours ago, seadoggie01 said:

Edit2: Per the HTML Standard (?) a closing </option> tag isn't even required :D

Wouldn't it be weird if <select> didn't display any text in options?
Even so Google Chrome Browser evalutes this following form:

<option value="1" class="1" />

to this:

<option value="1" class="1"></option>


It looks like possible weired form is such form:

<option></option>


and this generates empty option element

 

 

as so far I have:
https://regex101.com/r/ba2YLV/1

 

#include <Array.au3>

_Example()

Func _Example()

;~  Local $sHTML = _
;~          '<select id="OptionToChoose">' & @CRLF & _
;~          '   <option value="" selected="selected">Choose option</option>' & @CRLF & _
;~          '   <option value="1">Sun</option>' & @CRLF & _
;~          '   <option value="2">Earth</option>' & @CRLF & _
;~          '   <option value="3">Moon</option>' & @CRLF & _
;~          '</select>' & @CRLF & _
;~          ''

    Local $sHTML = _
            '<select id="OptionToChoose">' & @CRLF & _
            '   <option value="" selected="selected">Choose option</option>' & @CRLF & _
            '   <option></option>' & @CRLF & _
            '   <option value="1" class="1">Sun</option>' & @CRLF & _
            '   <option class="2" value="2">Earth</option>' & @CRLF & _
            '   <option class="3" selected="selected" value="3" color="blue">Moon</option>' & @CRLF & _
            '</select>' & @CRLF & _
            ''
    ConsoleWrite($sHTML & @CRLF)


    ; StringRegExp : $STR_REGEXPARRAYGLOBALFULLMATCH  - Option 4, global return, php/preg_match_all() style
    Local $aOuter = StringRegExp($sHTML, '(?is)(?:<option)([^>]*)( value="[^"]*")([^>]*\>|\>)([^>]*)(?:<)', $STR_REGEXPARRAYGLOBALFULLMATCH)
    _ArrayDisplay($aOuter, '$aOuter')

    Local $aInner
    For $IDX_Out = 0 To UBound($aOuter) - 1
        $aInner = $aOuter[$IDX_Out]
;~      StringInStr($aInner[]
        _ArrayDisplay($aInner, '$aInner = $aOuter[$IDX_Out] ... $IDX_Out = ' & $IDX_Out)
    Next

EndFunc   ;==>_Example



Is this looks like a complex RegExp ?

The main concet is to get value and option always on the same row.
But I also need to know if there is any option seclected to return to ID of selected option.

image.png.c0d6fdcbc101db0962f367cbb77a7ec8.png

image.png

Edited by mLipok

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 APIErrorLog.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 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: 2022-03-07

Link to post
Share on other sites

I hope that this will be finall example:

 

#include <Array.au3>

_Example()

Func _Example()

;~  Local $sHTML = _
;~          '<select id="OptionToChoose">' & @CRLF & _
;~          '   <option value="">Choose option</option>' & @CRLF & _
;~          '   <option></option>' & @CRLF & _
;~          '   <option value="1" class="1">Sun</option>' & @CRLF & _
;~          '   <option class="2" selected="selected" value="2">Earth</option>' & @CRLF & _
;~          '   <option class="3" value="3" color="blue">Moon</option>' & @CRLF & _
;~          '</select>' & @CRLF & _
;~          ''

    Local $sHTML = _
            '<select id="OptionToChoose">' & @CRLF & _
            '   <option value="" selected="selected">Choose option</option>' & @CRLF & _
            '   <option></option>' & @CRLF & _
            '   <option value="1" class="1">Sun</option>' & @CRLF & _
            '   <option class="2" value="2">Earth</option>' & @CRLF & _
            '   <option class="3" selected="selected" value="3" color="blue">Moon</option>' & @CRLF & _
            '</select>' & @CRLF & _
            ''
    ConsoleWrite($sHTML & @CRLF)


    ; StringRegExp : $STR_REGEXPARRAYGLOBALFULLMATCH  - Option 4, global return, php/preg_match_all() style
    $sHTML = StringReplace($sHTML, '<option></option>', '<option value=""></option>') ; fix for '<option></option>' must contain value="" to RegExp works
    Local $aOuter = StringRegExp($sHTML, '(?is)(?:<option)([^>]*)( value="[^"]*")([^>]*\>|\>)([^>]*)(?:<)', $STR_REGEXPARRAYGLOBALFULLMATCH)
;~  _ArrayDisplay($aOuter, '$aOuter')
    Local $iSelectedOption = -1
    Local $aInner, $sText = ''
    For $IDX_Out = 0 To UBound($aOuter) - 1
        $aInner = $aOuter[$IDX_Out]
        If $iSelectedOption = -1 And (StringInStr($aInner[1], 'selected="selected"') Or StringInStr($aInner[3], 'selected="selected"')) Then $iSelectedOption = $IDX_Out
        _ArrayDisplay($aInner, '$aInner = $aOuter[$IDX_Out] ... $IDX_Out = ' & $IDX_Out)
        $aInner[2] = StringRegExpReplace($aInner[2], '(?i)(.+value=")(.*?)(")','$2') ; remove atribute name and quotation - only value is needed
        $sText &= (($sText <> "") ? @CRLF : "") & $aInner[2] & '|' & $aInner[4]
    Next
    ConsoleWrite("! $sText = " & @CRLF & $sText & @CRLF)
    ConsoleWrite("! $iSelectedOption = " & $iSelectedOption & @CRLF)

    Local $aOut[0][2]
    _ArrayAdd($aOut, $sText, 0, Default, @CRLF, 1)
    _ArrayDisplay($aOut, '$aOut $iSelectedOption = ' & $iSelectedOption)

EndFunc   ;==>_Example

 

Edited by mLipok

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 APIErrorLog.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 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: 2022-03-07

Link to post
Share on other sites

So today few times I get:
 

Quote

__WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"invalid argument: user data directory is already in ...

__WD_Post ==> Invalid argument: {"value":{"error":"invalid argument","message":"invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir","stacktrace":"Backtrace:\n\tOrdinal0 [0x01096903+2517251]\n\tOrdinal0 [0x0102F8E1+2095329]\n\tOrdinal0 [0x00F32848+1058888]\n\tOrdinal0 [0x00F4D8AB+1169579]\n\tOrdinal0 [0x00F4A2CF+1155791]\n\tOrdinal0 [0x00F7AAAF+1354415]\n\tOrdinal0 [0x00F7A71A+1353498]\n\tOrdinal0 [0x00F7639B+1336219]\n\tOrdinal0 [0x00F527A7+1189799]\n\tOrdinal0 [0x00F53609+1193481]\n\tGetHandleVerifier [0x01225904+1577972]\n\tGetHandleVerifier [0x012D0B97+2279047]\n\tGetHandleVerifier [0x01126D09+534521]\n\tGetHandleVerifier [0x01125DB9+530601]\n\tOrdinal0 [0x01034FF9+2117625]\n\tOrdinal0 [0x010398A8+2136232]\n\tOrdinal0 [0x010399E2+2136546]\n\tOrdinal0 [0x01043541+2176321]\n\tBaseThreadInitThunk [0x75B3FA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77037A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77037A6E+238]\n"}}


_WD_CreateSession: {"value":{"error":"invalid argument","message":"invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir","stacktrace":"Backtrace:\n\tOrdinal0 [0x01096903+2517251]\n\tOrdinal0 [0x0102F8E1+2095329]\n\tOrdinal0 [0x00F32848+1058888]\n\tOrdinal0 [0x00F4D8AB+1169579]\n\tOrdinal0 [0x00F4A2CF+1155791]\n\tOrdinal0 [0x00F7AAAF+1354415]\n\tOrdinal0 [0x00F7A71A+1353498]\n\tOrdinal0 [0x00F7639B+1336219]\n\tOrdinal0 [0x00F527A7+1189799]\n\tOrdinal0 [0x00F53609+1193481]\n\tGetHandleVerifier [0x01225904+1577972]\n\tGetHandleVerifier [0x012D0B97+2279047]\n\tGetHandleVerifier [0x01126D09+534521]\n\tGetHandleVerifier [0x01125DB9+530601]\n\tOrdinal0 [0x01034FF9+2117625]\n\tOrdinal0 [0x010398A8+2136232]\n\tOrdinal0 [0x010399E2+2136546]\n\tOrdinal0 [0x01043541+2176321]\n\tBaseThreadInitThunk [0x75B3FA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77037A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77037A6E+238]\n"}}
_WD_CreateSession ==> Webdriver Exception: HTTP status = 400
 

and program exits due to @error handling.

but few attempts later:
 

Quote

_WD_IsLatestRelease: True
_WD_IsLatestRelease ==> Success
_WD_Startup: OS:    WIN_10 WIN32_NT 19044 
_WD_Startup: AutoIt:    3.3.15.5
_WD_Startup: WD.au3:    0.5.0.3 (Up to date)
_WD_Startup: WinHTTP:    1.6.4.2
_WD_Startup: Driver:    chromedriver.exe
_WD_Startup: Params:    
_WD_Startup: Port:    9515
__WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={
    "capabilities":{
        "alwaysMatch":{
            "acceptInsecureCerts":true
        },
        "firstMatch":[
            {
                "browserName":"chrome",
                "goog:chromeOptions":{
                    "w3c":true,
                    "args":[
                        "user-agent=Mozilla\/5.0 (Windows NT 10.0; Win64; X64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/96.0.4664.110 Safari\/537.36",
                        "user-data-dir=C:\\Users\\Szef\\AppData\\Local\\Google\\Chrome\\User Data\\Default",
                        "--profile-directory=default",
                        "start-maximized",
                        "disable-infobars",
                        "--no-sandbox",
                        "--disable-blink-features=AutomationControlled",
                        "--disable-web-security",
                        "--allow-running-insecure-content",
                        "--ignore-certificate-errors",
                        "--headless"
                    ],
                    "prefs":{
                        "credentials_enable_service":false,
                        "download.default_directory":"Z:\\!!!_SVN_AU3\\UDF_ML\\Testing\\TESTING_DOWNLOAD"
                    },
                    "excludeSwitches":[
                        "disable-popup-blocking",
                        "enable-automation",
                        "load-extension"
                    ]
                }
            }
        ]
    }
}
__WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":true,"browserName":"chrome","browserVersion":"96.0.4...
_WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":true,"browserName":"chrome","browserVersion":"96.0.4664.110","chrome":{"chromedriverVersion":"96.0.4664.45 (76e4c1bb2ab4671b8beba3444e61c0f17584b2fc-refs/branch-heads/4664@{#947})","userDataDir":"C:\\Users\\Szef\\AppData\\Local\\Google\\Chrome\\User Data\\Default"},"goog:chromeOptions":{"debuggerAddress":"localhost:62223"},"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":"f7c8d4bea5f711c49040338825cc8c75"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/execute/sync; $sData={"script":"return window.devicePixelRatio", "args":[]}
__WD_Post: StatusCode=200; ResponseText={"value":1}...
_WD_ExecuteScript: {"value":1}...
_WD_ExecuteScript ==> Success: HTTP status = 200
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/url; $sData={"url":"************************"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_Navigate: {"value":null}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/execute/sync; $sData={"script":"return document.readyState", "args":[]}
__WD_Post: StatusCode=200; ResponseText={"value":"complete"}...
_WD_ExecuteScript: {"value":"complete"}...
_WD_ExecuteScript ==> Success: HTTP status = 200
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element; $sData={"using":"css selector","value":"#nkw .clear-book"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"ea97d80d-2456-443d-9609-ff0598171e48"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"ea97d80d-2456-443d-9609-ff0598171e48"}}
__WD_Get: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/ea97d80d-2456-443d-9609-ff0598171e48/displayed
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":true}...
_WD_ElementAction: {"value":true}...
__WD_Get: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/ea97d80d-2456-443d-9609-ff0598171e48/enabled
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":true}...
_WD_ElementAction: {"value":true}...
_WD_WaitElement ==> Success
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/ea97d80d-2456-443d-9609-ff0598171e48/click; $sData={"id":"ea97d80d-2456-443d-9609-ff0598171e48"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_ElementAction: {"value":null}...
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element; $sData={"using":"css selector","value":"select#kodWydzialu"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"5e420b4e-5271-4c2a-af2a-a6680e4bcb56"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"5e420b4e-5271-4c2a-af2a-a6680e4bcb56"}}
__WD_Get: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/5e420b4e-5271-4c2a-af2a-a6680e4bcb56/property/nodeName
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"SELECT"}...
_WD_ElementAction: {"value":"SELECT"}...
__WD_Get: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/5e420b4e-5271-4c2a-af2a-a6680e4bcb56/property/outerHTML
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":"\u003Cselect id=\"kodWydzialu\" name=\"kodEci\" class=\"required hide\">\n                ...
_WD_ElementAction: {"value":"\u003Cselect id=\"kodWydzialu\" name=\"kodEci\" class=\"required hide\">\n                ...
_WD_ElementSelectAction: (array)
_WD_ElementSelectAction ==> Success
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element; $sData={"using":"css selector","value":"select#kodWydzialu ~ input"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"acc86ed7-f0e4-4e84-854e-a0b58fe49bbe"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"acc86ed7-f0e4-4e84-854e-a0b58fe49bbe"}}
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/acc86ed7-f0e4-4e84-854e-a0b58fe49bbe/value; $sData={"id":"acc86ed7-f0e4-4e84-854e-a0b58fe49bbe", "text":"KA1P"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_ElementAction: {"value":null}...
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element; $sData={"using":"xpath","value":"//*[@id='numerKsiegiWieczystej']"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"e83ca5de-de7d-4a0d-80fb-a96b827a8868"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"e83ca5de-de7d-4a0d-80fb-a96b827a8868"}}
__WD_Get: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/e83ca5de-de7d-4a0d-80fb-a96b827a8868/displayed
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":true}...
_WD_ElementAction: {"value":true}...
__WD_Get: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/e83ca5de-de7d-4a0d-80fb-a96b827a8868/enabled
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":true}...
_WD_ElementAction: {"value":true}...
_WD_WaitElement ==> Success
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/e83ca5de-de7d-4a0d-80fb-a96b827a8868/clear; $sData={"id":"e83ca5de-de7d-4a0d-80fb-a96b827a8868"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_ElementAction: {"value":null}...
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/e83ca5de-de7d-4a0d-80fb-a96b827a8868/value; $sData={"id":"e83ca5de-de7d-4a0d-80fb-a96b827a8868", "text":"00050565"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_ElementAction: {"value":null}...
_WD_SetElementValue ==> Success
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element; $sData={"using":"xpath","value":"//*[@id='cyfraKontrolna']"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"242496b6-212c-4fe6-9fb2-ef8dccae156f"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"242496b6-212c-4fe6-9fb2-ef8dccae156f"}}
__WD_Get: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/242496b6-212c-4fe6-9fb2-ef8dccae156f/displayed
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":true}...
_WD_ElementAction: {"value":true}...
__WD_Get: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/242496b6-212c-4fe6-9fb2-ef8dccae156f/enabled
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":true}...
_WD_ElementAction: {"value":true}...
_WD_WaitElement ==> Success
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/242496b6-212c-4fe6-9fb2-ef8dccae156f/clear; $sData={"id":"242496b6-212c-4fe6-9fb2-ef8dccae156f"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_ElementAction: {"value":null}...
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/242496b6-212c-4fe6-9fb2-ef8dccae156f/value; $sData={"id":"242496b6-212c-4fe6-9fb2-ef8dccae156f", "text":"0"}
__WD_Post: StatusCode=200; ResponseText={"value":null}...
_WD_ElementAction: {"value":null}...
_WD_SetElementValue ==> Success
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element; $sData={"using":"css selector","value":".error-content .visible"}
__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\":\"css selector\",\"selector\":\".error-content .visible\"}\n  (Session info: headless chrome=96.0.4664.110)","stacktrace":"Backtrace:\n\tOrdinal0 [0x01096903+2517251]\n\tOrdinal0 [0x0102F8E1+2095329]\n\tOrdinal0 [0x00F32848+1058888]\n\tOrdinal0 [0x00F5D448+1233992]\n\tOrdinal0 [0x00F5D63B+1234491]\n\tOrdinal0 [0x00F87812+1406994]\n\tOrdinal0 [0x00F7650A+1336586]\n\tOrdinal0 [0x00F85BBF+1399743]\n\tOrdinal0 [0x00F7639B+1336219]\n\tOrdinal0 [0x00F527A7+1189799]\n\tOrdinal0 [0x00F53609+1193481]\n\tGetHandleVerifier [0x01225904+1577972]\n\tGetHandleVerifier [0x012D0B97+2279047]\n\tGetHandleVerifier [0x01126D09+534521]\n\tGetHandleVerifier [0x01125DB9+530601]\n\tOrdinal0 [0x01034FF9+2117625]\n\tOrdinal0 [0x010398A8+2136232]\n\tOrdinal0 [0x010399E2+2136546]\n\tOrdinal0 [0x01043541+2176321]\n\tBaseThreadInitThunk [0x75B3FA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77037A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77037A6E+238]\n"}}
_WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"css selector\",\"selector\":\".error-content .visible\"}\n  (Session info: headless chrome=96.0.4664.110)","stacktrace":"Backtrace:\n\tOrdinal0 [0x01096903+2517251]\n\tOrdinal0 [0x0102F8E1+2095329]\n\tOrdinal0 [0x00F32848+1058888]\n\tOrdinal0 [0x00F5D448+1233992]\n\tOrdinal0 [0x00F5D63B+1234491]\n\tOrdinal0 [0x00F87812+1406994]\n\tOrdinal0 [0x00F7650A+1336586]\n\tOrdinal0 [0x00F85BBF+1399743]\n\tOrdinal0 [0x00F7639B+1336219]\n\tOrdinal0 [0x00F527A7+1189799]\n\tOrdinal0 [0x00F53609+1193481]\n\tGetHandleVerifier [0x01225904+1577972]\n\tGetHandleVerifier [0x012D0B97+2279047]\n\tGetHandleVerifier [0x01126D09+534521]\n\tGetHandleVerifier [0x01125DB9+530601]\n\tOrdinal0 [0x01034FF9+2117625]\n\tOrdinal0 [0x010398A8+2136232]\n\tOrdinal0 [0x010399E2+2136546]\n\tOrdinal0 [0x01043541+2176321]\n\tBaseThreadInitThunk [0x75B3FA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77037A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77037A6E+238]\n"}}
_WD_FindElement ==> No match: HTTP status = 404
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element; $sData={"using":"xpath","value":"//*[@id='wyszukaj']"}
__WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"259e6b71-6b8f-44fe-9d08-2a050419b844"}}...
_WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"259e6b71-6b8f-44fe-9d08-2a050419b844"}}
__WD_Get: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/259e6b71-6b8f-44fe-9d08-2a050419b844/displayed
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":true}...
_WD_ElementAction: {"value":true}...
__WD_Get: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/259e6b71-6b8f-44fe-9d08-2a050419b844/enabled
__WD_Get: StatusCode=200; $iResult = 0; $sResponseText={"value":true}...
_WD_ElementAction: {"value":true}...
_WD_WaitElement ==> Success
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element/259e6b71-6b8f-44fe-9d08-2a050419b844/click; $sData={"id":"259e6b71-6b8f-44fe-9d08-2a050419b844"}
__WD_Post: StatusCode=0; ResponseText=WinHTTP request timed out before Webdriver...
__WD_Post ==> Send / Recv error: WinHTTP request timed out before Webdriver
_WD_ElementAction: WinHTTP request timed out before Webdriver...
_WD_ElementAction ==> Send / Recv error: WinHTTP request timed out before Webdriver
__WD_Post: URL=HTTP://127.0.0.1:9515/session/f7c8d4bea5f711c49040338825cc8c75/element; $sData={"using":"xpath","value":"//*[@id='przyciskWydrukZwykly']"}
__WD_Post: StatusCode=0; ResponseText=WinHTTP request timed out before Webdriver...
__WD_Post ==> Send / Recv error: WinHTTP request timed out before Webdriver
_WD_FindElement: WinHTTP request timed out before Webdriver
_WD_FindElement ==> Send / Recv error: HTTP status = 0
_WD_WaitElement ==> Timeout
! 381 - NOT COMPILED Intercept_MessageBoxW WATCH POINT
 

and at the same time I get:

 

image.png

 

Alll this following process they are suspended browser processes that were being automated during test execution.
Chromedriver.exe is closed but chrome.exe is still sitting in the background.

image.png.0254df64a7d67482848d98d823abd045.png

 

are 

Edited by mLipok

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 APIErrorLog.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 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: 2022-03-07

Link to post
Share on other sites

The main problem is why Chormedriver not always gives information "invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir" ?

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 APIErrorLog.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 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: 2022-03-07

Link to post
Share on other sites
44 minutes ago, mLipok said:

The main problem is why Chormedriver not always gives information "invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir" ?

1) Have you tried checking ProcessExists() at the beginning of your script (even if it's just for debugging purposes)? You could also use something like ProcExp to try to identify the processes that have those resources in use.

2) It's possible that __WD_CloseDriver needs improvement in how it forcibly shuts down the webdriver

3) Please be mindful that some discussions are outside the scope of this thread and should either go into a separate thread or the one in GH&S. 😉

Link to post
Share on other sites

Good morning, I would like to know if there is an option to save a page that I have open in pdf, as if I did a CTRL + P, and there appears a print window but instead of giving it print, it is given to save the pdf to this page, I do not know if this is possible to save the active page in pdf? I would appreciate the answer to know if this is possible, at the moment I am making it take a print of an element, but this takes me an image, and I would like to do it in pdf to be able to copy the data it brings.

Link to post
Share on other sites

This thread is not about getting help.
It is about WD UDF in context of maintaining this UDF releases etc....

Ask here:

 

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 APIErrorLog.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 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: 2022-03-07

Link to post
Share on other sites
  • Danp2 changed the title to WebDriver UDF (W3C compliant version) - 01/19/2022

Latest update just released. See below for change log.

Quote

    v0.5.1.0
    - Changed: _WD_GetElementFromPoint
        - Sets @Extended to shown context changed
        - Additional error checking
    - Changed (_WD_ExecuteScript): Add support for return of additional subnodes
    - Added: $_WD_JSON_* constants
    - Chore: Update various functions to use $_WD_JSON_* constants
    - Changed (_WD_GetBrowserVersion): Returns "0" on failure instead of ""             *** Script breaking change ***
    - Changed (_WD_GetWebDriverVersion): Returns "0" on failure instead of "None"         *** Script breaking change ***
    - Changed: _WD_UpdateDriver
        - Added checks for valid installation directory
        - Added check for existing 32/64 bit driver
        - Fixed $bForce / $KEYWORD_NULL implementation
        - Improved version comparison
        - Improved zip extraction
        - Fixed regex used with geckodriver
    - Changed (_WD_Screenshot): Improved error handling
    - Fixed (_WD_GetShadowRoot, _WD_SelectFiles, _WD_SetTimeouts): Correctly initialize return value

 

Link to post
Share on other sites
  • Danp2 changed the title to WebDriver UDF (W3C compliant version) - 01/31/2022

Hi @Danp2,

first of all, thanks for the notification 👍 . I do have two suggestions which could improve the transparency about the project and changes.

  • Let us create a CHANGELOG.md file for the GitHub project and refer to it for the future notifications/updates.
  • Let us use Semantic Versioning to fit better in common versioning expectations.

If you as creator, the other contributors and also the community don't mind, I would prepare a pull request which could be reviewed 😅 .
If you Dan think, to open a GitHub Issue first would be better, I also will do so.


Best regards
Sven

________________
Stay innovative!

Link to post
Share on other sites
31 minutes ago, SOLVE-SMART said:

Let us create a CHANGELOG.md file for the GitHub project and refer to it for the future notifications/updates.

We already have REVISIONS.MD, which is where this information is maintained. I simply copy it here for the convenience of others.

Quote

Let us use Semantic Versioning to fit better in common versioning expectations.

I would suggest opening a GH issue on this one.

Link to post
Share on other sites
  • Danp2 changed the title to WebDriver UDF (W3C compliant version) - 06/04/2022

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By levila
      Hi Guys, i just do some codding to automate login to some of the web.
      I manage to do the script but somehow after script done, some weird box popup. and keep looping until i close the main chrome.exe

      here is my code. kinldy pls assist, im very new to webdriver udf.
      #NoTrayIcon #include "wd_core.au3" #include "wd_helper.au3" $_WD_DEBUG = $_WD_DEBUG_None ; You could also use $_WD_DEBUG_Error Local $sDesiredCapabilities, $sSession SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://someoftheweb.com") _ChromeSetInputValueByName($sSession, "inputName", "Username") _ChromeSetInputValueById($sSession, "inputPassword", "Password") _ChromeSetMouseClick($sSession, "submit", "click") _WD_Shutdown() Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--no-sandbox"]}}}}' EndFunc Func _ChromeSetInputValueByName($sSession,$name,$Value) $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='"&$name&"']") _WD_ElementAction($sSession,$sButton,'value', $Value) EndFunc Func _ChromeSetInputValueById($sSession,$Id,$Value) $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='"&$Id&"']") _WD_ElementAction($sSession,$sButton,'value', $Value) EndFunc Func _ChromeSetMouseClick($sSession,$Id,$Value) $sButton = _WD_FindElement($sSession,$_WD_LOCATOR_ByXPath,"//button[@type='"&$Id&"']") _WD_ElementAction($sSession, $sButton, 'click', $Value) EndFunc  
    • By RohanM
      Hi Team,
      is there is a way to embed the webpage in auto it GUI using webdriver? what I want to do is that, I want to open edge browser inside the AutoIT GUI, in IE we have _IECreateEmbedded function but for the webdriver I am not able to find a function, please help  
      Rohan M
    • By goku200
      I am trying to change the settings of the print option to Save as PDF and its not changing the settings and clicking on the Save button at the bottom. Here is my script that I have written and the format is correct below. Chrome browser I'm using is 97.0 My script was working fine using Chrome 95.0\ Not sure why its not working now
      It finds the print-preview-app element but not the others.
       
    • By goku200
      I am trying to hit the Return key without having to use the Send keys. I have the following code and its not hitting the Return key. Am I missing something?
      ; Press Return $sAction = '{"actions":[{"type": "key", "id": "keyboard_1", "actions": [{"type": "keyDown", "value": "\uE006"},' ; Pause $sAction &= '{"type": "pause", "duration": 500},' ; Release Return $sAction &= '{"type": "keyUp", "value": "\uE006"}]}]}' _WD_Action($sSession, "actions", $sAction)  
    • By goku200
      I'm having an issue with my html paginated table. The script work as expected. It reads the html table and clicks on the Download button. However when it clicks on the next page its not iterating the items. instead it goes to the next URL from the spreadsheet and then iterates through the html table clicking the Download button and so on. Not sure why its doing that. I want it to click the next page and then continue iterating then after it has reached the end of the pagination go to the next url in the spreadsheet and repeat the process. Below is my script. Any help is appreciated 🙂
       
       
×
×
  • Create New...