Chromedriver not deleting scoped* dir in temp folder after test is complete

后端 未结 6 1717
野性不改
野性不改 2021-02-07 09:26

With latest chromedriver.exe running into out of disk space issues as chromedriver is not deleting the folder named scoped_* at the end of the execution. It is occupying almost

6条回答
  •  眼角桃花
    2021-02-07 09:52

    was reported and fixed. Checkout 2.30 or 2.31

    UPD. at least works for our grid. If you still have issues it's better you report in into any scope_dir thread on productforums.google.com In addition before it was fixed we used PS script that cleared all files in ..*\AppData\Local\Temp

    UPD. check out the chrome browser has completed update process. Along with this fix we had an issue that browser keep in state "restart required for update to complete" even after restart. It's maybe both browser and driver are to be updated for fix to work- can not say for sure.

    UPD2. I see some people still have the issue. (maybe they re-released it?) Here the sample of a PS script that was used on Win machine at the time we had the issue. Cleaner.ps1

    #infinite loop for calling  function   
    $ScriptPath = $MyInvocation.MyCommand.Definition
    
    # 2030 year error
    $timeout = new-timespan -end (get-date -year 2030 -month 1 -day 1)
    $sw = [diagnostics.stopwatch]::StartNew()
    while ($sw.elapsed -lt $timeout){
        if (-Not (test-path  $ScriptPath)){
            write-host "v been renamed, quiting!"
            return
            }
    
        start-sleep -seconds 60
        # logic
    $time=Get-Date
    $maxdate = $time.AddMinutes(-120)
    Get-WmiObject -Class Win32_UserProfile  | Foreach-Object {
        $path =  $_.LocalPath 
        if (-Not $path.Contains('Windows')){
        echo $path
        $Files = Get-ChildItem "$($path)\..\*\AppData\Local\Temp" -recurse | ?  {$_.LastWriteTime -lt $maxdate } |
         remove-item -force -recurse
        echo $Files 
    
        }
    }   
    }
    

    run.bat

    #PowerShell -Command "Set-ExecutionPolicy Unrestricted" >> "%TEMP%\StartupLog.txt" 2>&1 
    PowerShell C:\path2CleanerFolder\Cleaner.ps1
    

    GL

提交回复
热议问题