Jump to content

mLipok

MVPs
  • Posts

    11,490
  • Joined

  • Last visited

  • Days Won

    60

mLipok last won the day on June 4

mLipok had the most liked content!

About mLipok

  • Birthday 07/19/1978

Profile Information

  • Member Title
    I'm nitpicky sometimes.
  • Location
    Europe, Poland, Upper Silesia, Zabrze
  • Interests
    ¯\_(ツ)_/¯

Recent Profile Visitors

27,045 profile views

mLipok's Achievements

  1. Has anyone tried using the Smart Card Minidriver? Some references: https://learn.microsoft.com/en-us/previous-versions/windows/hardware/design/dn631754(v=vs.85)#smart-card-minidriver-specification-v707 https://download.microsoft.com/download/3/3/2/332fd70b-f04d-470a-a135-040350b9563f/sc-minidriver_specs_v7.07.docx
  2. @jpm maybe the same way like here: https://www.autoitscript.com/trac/autoit/ticket/3849#comment:2 @rikthhpgf2005 please use this script to post here result as text ; Dec, Int, Number Constants Global Const $NUMBER_AUTO = 0 Global Const $NUMBER_32BIT = 1 Global Const $NUMBER_64BIT = 2 Global Const $NUMBER_DOUBLE = 3 Global Const $tagOSVERSIONINFO = 'struct;dword OSVersionInfoSize;dword MajorVersion;dword MinorVersion;dword BuildNumber;dword PlatformId;wchar CSDVersion[128];endstruct' ConsoleWrite('Windows version: ' & _WinAPI_GetVersion() & @CRLF) Func _WinAPI_GetVersion() Local $tOSVI = DllStructCreate($tagOSVERSIONINFO) DllStructSetData($tOSVI, 1, DllStructGetSize($tOSVI)) Local $aCall = DllCall('kernel32.dll', 'bool', 'GetVersionExW', 'struct*', $tOSVI) If @error Or Not $aCall[0] Then Return SetError(@error, @extended, 0) MsgBox(0, "OSVERSIONINFO", "MajorVersion = " & DllStructGetData($tOSVI, "MajorVersion") & @CRLF & _ "MinorVersion = " & DllStructGetData($tOSVI, "MinorVersion") & @CRLF & _ "BuildNumber = " & DllStructGetData($tOSVI, "BuildNumber")) Return Number(DllStructGetData($tOSVI, "MajorVersion") & "." & DllStructGetData($tOSVI, "MinorVersion"), $NUMBER_DOUBLE) EndFunc ;==>_WinAPI_GetVersion or even this one: #AutoIt3Wrapper_Change2CUI=y ; Dec, Int, Number Constants Global Const $NUMBER_AUTO = 0 Global Const $NUMBER_32BIT = 1 Global Const $NUMBER_64BIT = 2 Global Const $NUMBER_DOUBLE = 3 Global Const $tagOSVERSIONINFO = "struct;dword OSVersionInfoSize;dword MajorVersion;dword MinorVersion;dword BuildNumber;dword PlatformId;wchar CSDVersion[128];endstruct" Global $sInformation = _ "AutoIt version: " & @AutoItVersion & @CRLF & _ "Windows version: " & _WinAPI_GetVersion() & @CRLF & " Build: " & @extended & @CRLF & _ "@OSVersion: " & @OSVersion & @CRLF & _ "@OSType: " & @OSType & @CRLF & _ "" ConsoleWrite($sInformation & @CRLF) ClipPut($sInformation) Func _WinAPI_GetVersion() Local $tOSVI = DllStructCreate($tagOSVERSIONINFO) DllStructSetData($tOSVI, 1, DllStructGetSize($tOSVI)) Local $aCall = DllCall('kernel32.dll', 'bool', 'GetVersionExW', 'struct*', $tOSVI) If @error Or Not $aCall[0] Then Return SetError(@error, @extended, 0) MsgBox(0, "OSVERSIONINFO", "MajorVersion = " & DllStructGetData($tOSVI, "MajorVersion") & @CRLF & _ "MinorVersion = " & DllStructGetData($tOSVI, "MinorVersion") & @CRLF & _ "BuildNumber = " & DllStructGetData($tOSVI, "BuildNumber")) Return SetError(0, Number(DllStructGetData($tOSVI, "BuildNumber")), Number(DllStructGetData($tOSVI, "MajorVersion") & "." & DllStructGetData($tOSVI, "MinorVersion"), $NUMBER_DOUBLE)) EndFunc ;==>_WinAPI_GetVersion
  3. You can test it with wd_demo.au3 by replacing the SetupGecko() function with this following one: Func SetupGecko($bHeadless) _WD_Option('Driver', 'geckodriver.exe') Local $iPort = _WD_GetFreePort(4444, 4500) If @error Then Return SetError(@error, @extended, 0) _WD_Option('Port', $iPort) _WD_Option('DriverParams', '--port=' & $iPort & ' --log-no-truncate') ; https://firefox-source-docs.mozilla.org/testing/geckodriver/Flags.html ;~ Local $sCapabilities = '{"capabilities": {"alwaysMatch": {"browserName": "firefox", "acceptInsecureCerts":true}}}' _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'firefox') _WD_CapabilitiesAdd('browserName', 'firefox') _WD_CapabilitiesAdd('acceptInsecureCerts', True) ; REMARKS ; When using 32bit geckodriver.exe, you may need to set 'binary' option. ; This shouldn't be needed when using 64bit geckodriver.exe, ; but at the same time setting it is not affecting the script. Local $sPath = _WD_GetBrowserPath("firefox") If Not @error Then _WD_CapabilitiesAdd('binary', $sPath) ConsoleWrite("wd_demo.au3: _WD_GetBrowserPath() > " & $sPath & @CRLF) EndIf Local $sLogDir = @ScriptDir & "\Log\" DirCreate($sLogDir) Local $sTimeStamp = @YEAR & '-' & @MON & '-' & @MDAY & '_' & @HOUR & @MIN & @SEC Local $sLogFile = $sLogDir & $sTimeStamp & '_Au3WebDriver_firefox.log' If $sLogFile Then EnvSet('GECKODRIVER_LOG', $sLogFile) ConsoleWrite("- GECKODRIVER_LOG: " & EnvGet('GECKODRIVER_LOG') & @CRLF) EnvSet('MOZ_LOG_FILE', $sLogFile) ConsoleWrite("- MOZ_LOG_FILE: " & EnvGet('MOZ_LOG_FILE') & @CRLF) _WD_CapabilitiesAdd('prefs', 'logging.config.clear_on_startup', True) ; https://firefox-source-docs.mozilla.org/xpcom/logging.html _WD_CapabilitiesAdd('prefs', 'logging.config.LOG_FILE', $sLogFile) ; https://firefox-source-docs.mozilla.org/xpcom/logging.html _WD_CapabilitiesAdd('prefs', 'logging.config.add_timestamp', True) ; https://firefox-source-docs.mozilla.org/xpcom/logging.html _WD_CapabilitiesAdd('prefs', 'logging.config.sync', True) ; https://firefox-source-docs.mozilla.org/xpcom/logging.html _WD_CapabilitiesAdd('prefs', 'logging.config.profilerstacks', True) ; https://firefox-source-docs.mozilla.org/xpcom/logging.html _WD_CapabilitiesAdd('args', 'service_log_path', $sLogFile) _WD_CapabilitiesAdd('env', "MOZ_LOG", "nsHttp:5") _WD_CapabilitiesAdd('env', "MOZ_LOG_FILE", $sLogFile) EndIf 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
  4. even using MOZ_LOG accordingly to: https://developer.mozilla.org/en-US/docs/Web/WebDriver/Reference/Capabilities/firefoxOptions#example in this way If $sLogFile Then _WD_CapabilitiesAdd('env', "MOZ_LOG", "nsHttp:5") _WD_CapabilitiesAdd('env', "MOZ_LOG_FILE", $sLogFile) EndIf was not helpfull.
  5. So I was able to get this partialy working with using 'prefs' accordingly to https://firefox-source-docs.mozilla.org/xpcom/logging.html: _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'firefox') _WD_CapabilitiesAdd('browserName', 'firefox') _WD_CapabilitiesAdd('acceptInsecureCerts', True) _WD_CapabilitiesAdd('prefs', 'logging.config.clear_on_startup', True) ; https://firefox-source-docs.mozilla.org/xpcom/logging.html _WD_CapabilitiesAdd('prefs', 'logging.config.LOG_FILE', $sLogFile) ; https://firefox-source-docs.mozilla.org/xpcom/logging.html _WD_CapabilitiesAdd('prefs', 'logging.config.add_timestamp', True) ; https://firefox-source-docs.mozilla.org/xpcom/logging.html _WD_CapabilitiesAdd('prefs', 'logging.config.sync', True) ; https://firefox-source-docs.mozilla.org/xpcom/logging.html _WD_CapabilitiesAdd('prefs', 'logging.config.profilerstacks', True) ; https://firefox-source-docs.mozilla.org/xpcom/logging.html If $bHeadless Then _WD_CapabilitiesAdd('args', '--headless') _WD_CapabilitiesAdd('args', '-profile') _WD_CapabilitiesAdd('args', @LocalAppDataDir & '\Mozilla\Firefox\Profiles\WD_Testing_Profile') and with EnvSet() accordingly to: https://firefox-source-docs.mozilla.org/xpcom/logging.html in this way: EnvSet('MOZ_LOG_FILE', $sLogFile) instead: EnvSet('GECKODRIVER_LOG', $sLogFile) both ways 'prefs' and 'ENV' works partialy as the file is created but is empty - 0 bytes length. I'm stuck here and I'd like to ask for help in solving this puzzle.
  6. I was trying to use: If $sLogFile Then $sDriverParams &= ' --log-path="' & $sLogFile & '"' _WD_Option('DriverParams', $sDriverParams) on FireFox with geckodriver I get the same error as: So I start to search and found: https://geckodriver.org/how-do-i-enable-logging-for-geckodriver/ But I decied to use : ConsoleWrite("- " & EnvGet('GECKODRIVER_LOG') & @CRLF) ConsoleWrite("- " & EnvSet('GECKODRIVER_LOG', $sLogFile) & @CRLF) ConsoleWrite("- " & EnvGet('GECKODRIVER_LOG') & @CRLF) ConsoleWrite("- $sLogFile = " & $sLogFile & @CRLF) unfortunately it didn't work. I even use: and still didn't work. Any suggestion how to properly set log file for geckodriver ? using AutoIt ?
  7. I think they're changing the default behavior. But they also provide override switches here: https://chromium-review.googlesource.com/c/chromium/src/+/6515318/11/chrome/common/chrome_switches.cc EDIT: btw. the --do-not-de-elevate switch was provide in MsEdge in 2019 and still is there
  8. @n3wbie could you be so nice and check: https://github.com/Danp2/au3WebDriver/issues/532#issuecomment-3054090565
  9. added: _WinAPI_ShellGetFileInfo.au3 I can't remember how to complete the _WinAPI_DestroyIcon documentation "as a reference to _WinAPI_ShellGetFileInfo.au3" I hope someone else will complete this soon.
  10. Today I hit similar problem with chrome https://github.com/Danp2/au3WebDriver/issues/532
  11. I found an issue with Tidy.exe (some time ago) and finally today I had time to diagnose this issue. Using the main.au3 ; the following include will be not properly processed by Tidy.exe as it has comment at the end of the line #include "Include\incl1.au3" ; added:11/12/23 23:06:37 ; the following include will be properly processed by Tidy.exe as there is no comment at the end of the line #include "Include\incl1.au3" I get: Would you @Jos be so kind and take a look on this issue ? All files attached in zip TIDY_issue_with_comment_after_include.zip
  12. I had some issue with attacing to existing chrome. But it was very wired. First of all log: some findings: https://issues.chromium.org/issues/42323720 As you know I know about this: Finally I was able to attach to runing Chrome instances and this usually works fine. Today my situation was like this: I was working on automating a certain portal, to which a client logged in. This portal is something like an email box. To make sure that the page would not log me out, I refreshed the page every few minutes or clicked on some of its elements (inbox, trash, sent, etc.). I wrote 20 lines of code and did tests by connecting to an existing session. another 20 lines.... another 20 lines.... another 20 lines.... After about 2 hours of such work, the error that I mention above appeared. The log comes from the connection creation stage, i.e. the part of the code that I did not change. Simply refreshing the browser F5 did not help - unfortunately I did not check CTRL+F5 (or CTRL+SHIFT+R) that should perform a "hard refresh". Interestingly, the only solution that helped was manually navigating to another page within the same browser tab, and then navigating again to the automated portal, which fortunately did not log me out. Question: Do you have any idea why manually navigating to another portal and navigating back to the desired portal solves this problem? btw. Today I did reasarch on Au3Forum and I saw other related question - quite fresh - I think they may be related to my issue:
×
×
  • Create New...