Danp2 Posted June 3, 2022 Author Posted June 3, 2022 (edited) Not something that I've tried, but this is how I would approach it -- _WD_Startup returns the PID of the webdriver console Obtain an array of child processes by calling _WinAPI_EnumChildProcess with this PID Find the desired browser instance within this array Edit: It's even easier with Firefox. Just grab the value associated with "moz:processID" from $_WD_SESSION_DETAILS, which contains the JSON response from the webdriver when the session was created. Edited June 3, 2022 by Danp2 mLipok 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
mLipok Posted June 3, 2022 Posted June 3, 2022 expandcollapse popup; #FUNCTION# ==================================================================================================================== ; Name ..........: _WD_GetBrowserPID ; Description ...: Get browser PID ; Syntax ........: _WD_GetBrowserPID($iPID, $sBrowserName) ; Parameters ....: $iPID - WebDriver PID returned by _WD_Startup() ; $sBrowserName - [optional] Browser name from the list of supported browsers ($_WD_SupportedBrowsers) ; Return values .: Success - Browser PID ; Failure - "" and sets @error to one of the following values: ; - $_WD_ERROR_NotFound ; - $_WD_ERROR_NotSupported ; - $_WD_ERROR_NoMatch ; Author ........: mLipok ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _WD_GetBrowserPID($iPID, $sBrowserName = '') Local $aProcessList = _WinAPI_EnumChildProcess($iPID) If @error Then Return SetError($_WD_ERROR_NotFound, 0, '') Local $iIndex = _ArraySearch($_WD_SupportedBrowsers, $sBrowserName, Default, Default, Default, Default, Default, $_WD_BROWSER_Name) If @error Then Return SetError($_WD_ERROR_NotSupported, 0, '') If $sBrowserName = '' Then _ Return $aProcessList[1][0] Local $sBrowserExe = $_WD_SupportedBrowsers[$iIndex][$_WD_BROWSER_ExeName] For $i = 1 To $aProcessList[0][0] If $aProcessList[$i][1] = $sBrowserExe Then Return $aProcessList[$i][0] EndIf Next Return SetError($_WD_ERROR_NoMatch, @extended, '') EndFunc ;==>_WD_GetBrowserPID WARNING: not tested 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 Code * 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 API * ErrorLog.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 TaskScheduler * IE 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 stuff * OnHungApp handler * Avoid "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" , 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
HJL Posted June 3, 2022 Posted June 3, 2022 On 6/1/2022 at 9:34 PM, Danp2 said: Are you sure that you are running the most recent UDF version? I have 0.9.0 - should be the right one but sorry my question was wrong. I have used _WD_GetBrowserVersion("msedgedriver.exe") to get the driver version before I have startet it. And that returns since 01.06.2022 EdgeDrv:Edge before EdgeDrv:101.0.1210.53. So it is not the browser version, but the driver version that doesn't work. Is there another way?
Danp2 Posted June 3, 2022 Author Posted June 3, 2022 2 hours ago, HJL said: _WD_GetBrowserVersion("msedgedriver.exe") The correct command would be _WD_GetWebDriverVersion. Latest Webdriver UDF Release Webdriver Wiki FAQs
Danp2 Posted June 3, 2022 Author Posted June 3, 2022 @mLipokWhy go to the trouble of writing the function, but not test it before posting? 🙄 P.S. It doesn't work correctly when a browser name isn't supplied Latest Webdriver UDF Release Webdriver Wiki FAQs
HJL Posted June 3, 2022 Posted June 3, 2022 (edited) _WD_GetWebDriverVersion($sWebdriverPath, "msedgedriver.exe") = "Edge" Have you tried this with V 102.0.1245.30 ? Local $sOutput="Microsoft Edge WebDriver 102.0.1245.30 (8f49f1a4740db8559bf9e49b4a7b6c754f80250d)" Local $aMatches = StringRegExp($sOutput, "\s+([^\s]+)", 1) _ArrayDisplay($aMatches) There must be something wrong with StringRegExp(). And found it: up to the last version of msedgedriver the result was MSEdgeDriver 101.0.1210.53 (019dbf6dd738aa1846d87f5734878db0ee9df370) - so just one word before the version. Now there are three words 😉 Edited June 3, 2022 by HJL
Danp2 Posted June 3, 2022 Author Posted June 3, 2022 (edited) @HJLThe regex in that function will need to be updated. Edit: Changing "\s+([^\s]+)" to "\d+(\.\d+){2,}" appears to resolve the issue. Edited June 3, 2022 by Danp2 Latest Webdriver UDF Release Webdriver Wiki FAQs
HJL Posted June 3, 2022 Posted June 3, 2022 (edited) Got it: "([0-9.]+)" works for all three webdrivers. Edited June 3, 2022 by HJL
Danp2 Posted June 3, 2022 Author Posted June 3, 2022 Ok... I had the capture group incorrectly defined (never said I was any good at this regex stuff 😜). This revised regex is working for me -- "\d+(?:\.\d+){2,}" Latest Webdriver UDF Release Webdriver Wiki FAQs
mLipok Posted June 3, 2022 Posted June 3, 2022 3 hours ago, Danp2 said: @mLipokWhy go to the trouble of writing the function, but not test it before posting? 🙄 P.S. It doesn't work correctly when a browser name isn't supplied I started doing this function because it was on my TODO list, a client called and I had to stop working on this function. But I wanted to share what I had. Meanwhile, I have finished my work. Please check here: https://github.com/Danp2/au3WebDriver/pull/324 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 Code * 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 API * ErrorLog.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 TaskScheduler * IE 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 stuff * OnHungApp handler * Avoid "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" , 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
Danp2 Posted June 3, 2022 Author Posted June 3, 2022 @mLipok I am still encountering many issues with this new code. Would you prefer to discuss here or on Github? Latest Webdriver UDF Release Webdriver Wiki FAQs
mLipok Posted June 3, 2022 Posted June 3, 2022 When something is on github letit stay there 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 Code * 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 API * ErrorLog.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 TaskScheduler * IE 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 stuff * OnHungApp handler * Avoid "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" , 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
mLipok Posted June 6, 2022 Posted June 6, 2022 (edited) I have an issue with using _WD_ExecuteScript() on FF but it works on Chrome. Here is my testing script expandcollapse popup#include "wd_helper.au3" #include "wd_capabilities.au3" _Example() Func _Example() Local $sCapabilities = SetupGecko(False) ;~ Local $sCapabilities = SetupChrome(False) _WD_Startup() Local $sSession = _WD_CreateSession($sCapabilities) _WD_Navigate($sSession, 'https://ezamowienia.gov.pl/mo-client-board/bzp/list') MsgBox(0, "", 'wait') Local $s_Date = '2021/01/01' Local $s_JAVA_Script = _ "var fp = flatpickr('#lib-date-0', {});" & _ "fp.setDate( new Date('" & $s_Date & "'),true);" & _ "" ConsoleWrite("! " & $s_JAVA_Script & @CRLF) _WD_ExecuteScript($sSession, $s_JAVA_Script) EndFunc Func SetupGecko($bHeadless) _WD_Option('Driver', 'geckodriver.exe') _WD_Option('DriverParams', '--log trace') _WD_Option('Port', 4444) ;~ Local $sCapabilities = '{"capabilities": {"alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts":true}}}' _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'firefox') _WD_CapabilitiesAdd('browserName', 'firefox') _WD_CapabilitiesAdd('acceptInsecureCerts', True) If $bHeadless Then _WD_CapabilitiesAdd('args', '--headless') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sCapabilities = _WD_CapabilitiesGet() Return $sCapabilities EndFunc ;==>SetupGecko Func SetupChrome($bHeadless) _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') ;~ Local $sCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"]}}}}' _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') If $bHeadless Then _WD_CapabilitiesAdd('args', '--headless') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sCapabilities = _WD_CapabilitiesGet() Return $sCapabilities EndFunc ;==>SetupChrome Can anybody explain to me why it did not work on FF ? Edited June 6, 2022 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 * How to ask ChatGPT for AutoIt Code * 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 API * ErrorLog.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 TaskScheduler * IE 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 stuff * OnHungApp handler * Avoid "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" , 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
Danp2 Posted June 6, 2022 Author Posted June 6, 2022 17 minutes ago, mLipok said: Can anybody explain to me why it did not work on FF ? Please elaborate. What exactly isn't working as expected? Did you encounter any errors? P.S. Does it work if you manually run the commands from the FF Dev console? Latest Webdriver UDF Release Webdriver Wiki FAQs
mLipok Posted June 6, 2022 Posted June 6, 2022 (edited) No errors. Just in firefox date is not set in date picker element. Edited June 6, 2022 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 * How to ask ChatGPT for AutoIt Code * 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 API * ErrorLog.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 TaskScheduler * IE 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 stuff * OnHungApp handler * Avoid "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" , 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
Danp2 Posted June 6, 2022 Author Posted June 6, 2022 (edited) From the FF Dev console -- Quote Error: Invalid date supplied: "2021-01-01T06:00:00.000Z" de https://ezamowienia.gov.pl/mo-client-board/main-es2015.94dd897f12f5e4f68c3c.js:1 setDate https://ezamowienia.gov.pl/mo-client-board/main-es2015.94dd897f12f5e4f68c3c.js:1 <anonymous> https://ezamowienia.gov.pl/mo-client-board/bzp/list:2 <anonymous> https://ezamowienia.gov.pl/mo-client-board/bzp/list:3 main-es2015.94dd897f12f5e4f68c3c.js:1:1698012 From the Chrome Dev console -- Quote main-es2015.94dd897f12f5e4f68c3c.js:1 ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'dateFormat') TypeError: Cannot read properties of undefined (reading 'dateFormat') at A.n.setDate (main-es2015.94dd897f12f5e4f68c3c.js:1:1730336) at e.writeValue (main-es2015.94dd897f12f5e4f68c3c.js:1:1322534) at main-es2015.94dd897f12f5e4f68c3c.js:1:1400090 at main-es2015.94dd897f12f5e4f68c3c.js:1:1408269 at Array.forEach (<anonymous>) at pe.setValue (main-es2015.94dd897f12f5e4f68c3c.js:1:1408258) at main-es2015.94dd897f12f5e4f68c3c.js:1:1421287 at l.invoke (polyfills-es2015.8a706b3d5d3a4ffdb557.js:1:6624) at Object.onInvoke (main-es2015.94dd897f12f5e4f68c3c.js:1:894304) at l.invoke (polyfills-es2015.8a706b3d5d3a4ffdb557.js:1:6564) at T (polyfills-es2015.8a706b3d5d3a4ffdb557.js:1:12196) at polyfills-es2015.8a706b3d5d3a4ffdb557.js:1:13024 at l.invokeTask (polyfills-es2015.8a706b3d5d3a4ffdb557.js:1:7242) at Object.onInvokeTask (main-es2015.94dd897f12f5e4f68c3c.js:1:894193) at l.invokeTask (polyfills-es2015.8a706b3d5d3a4ffdb557.js:1:7163) at i.runTask (polyfills-es2015.8a706b3d5d3a4ffdb557.js:1:2651) at m (polyfills-es2015.8a706b3d5d3a4ffdb557.js:1:9236) at u.invokeTask [as invoke] (polyfills-es2015.8a706b3d5d3a4ffdb557.js:1:8321) at p (polyfills-es2015.8a706b3d5d3a4ffdb557.js:1:20575) at HTMLInputElement.f (polyfills-es2015.8a706b3d5d3a4ffdb557.js:1:20820) Haven't researched any further than this, but I suspect you are not calling the function with the correct parameters since both browsers are returning an error. Edited June 6, 2022 by Danp2 mLipok 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
Danp2 Posted June 6, 2022 Author Posted June 6, 2022 @mLipokThe following works for me in both Chrome and Firefox (both still show some errors in the browser console) -- Local $s_Date = '2021/06/10' Local $s_JAVA_Script = _ "var fp = flatpickr('#lib-date-0', {});" & _ "fp.setDate('" & $s_Date & "',true,'Y/m/d');" & _ "" _WD_ExecuteScript($sSession, $s_JAVA_Script) mLipok 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
mLipok Posted June 6, 2022 Posted June 6, 2022 Thanks @Danp2 It works. How did you handle this ? 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 Code * 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 API * ErrorLog.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 TaskScheduler * IE 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 stuff * OnHungApp handler * Avoid "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" , 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
Danp2 Posted June 6, 2022 Author Posted June 6, 2022 @mLipokI googled and found this site. It describes the flatpickr object's methods, their parameters, etc. After that, it was simply some trial and error testing from the browser console. mLipok 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
Recommended Posts