RohanM Posted March 15, 2023 Posted March 15, 2023 (edited) Hello Team, I am using webdriver with Edge browser, whenever script starts it will create temp file in the Temp folder(scoped_dir*), but once its shootdowns it will not delete those file automatically, its keep on creating and unnecessarily utilizing the HDD space. I am calling this function at the end of the script Func End_Browser() _WD_DeleteSession($Session) _WD_Shutdown($PID) EndFunc ;==>End_Browser capabilities Func SetupEdge() _WD_Option('driver', "C:\Script_Resources\msedgedriver.exe") _WD_Option('port', 9515) _WD_Option('driverclose', True) _WD_Option('driverparams', '--verbose --log-path="' & @LocalAppDataDir & '\msedge.log"') $Desired_Capabilities = '{"capabilities": {"alwaysMatch": {"ms:edgeOptions": {"binary": "' & _ StringReplace(@ProgramFilesDir, "\", "/") & '/Microsoft/Edge/Application/msedge.exe", "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false}}}}' EndFunc ;==>SetupEdge Edited March 15, 2023 by Jos added codebox... please use <> when posting code
Danp2 Posted March 15, 2023 Posted March 15, 2023 Is the outcome the same if you call _WD_Shutdown without the optional parameter? _WD_Shutdown() Latest Webdriver UDF Release Webdriver Wiki FAQs
RohanM Posted March 15, 2023 Author Posted March 15, 2023 Hello @Danp2 yes without any parameter I tried, still the same result, these are the file that keep on creating.
Danp2 Posted March 15, 2023 Posted March 15, 2023 @RohanMThis appears to be a timing issue where the webdriver console is closed via ProcessClose() before it has completed its cleanup process. I will open an issue on Github so that this can be reviewed / improved. In the mean time, you should be able to work around the issue by adding a call to Sleep() before _WD_Shutdown(). SOLVE-SMART 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
RohanM Posted March 15, 2023 Author Posted March 15, 2023 @Danp2 yes, your suggestion worked, I added Sleep before _WD_Shutdown(). thank you @Danp2 _WD_DeleteSession($Session) Sleep(8000) _WD_Shutdown()
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now