Geeks With Blogs

News Please visit me at my new blog!!

profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.



Programming and Learning from SD

I run automated UI test with Selenium (unit testing will do this as well, though not as many files) from the Visual Studio Test Explorer a lot. This creates a new folder inside of my solution location named TestResults for every test run. Depending on what I need to deploy for the test (Selenium chrome driver, images, dlls, etc) the size of that it takes up on my hard drive gets very large after a few weeks. I’ve deleted gigs before.

In the spirit of “if you do something more than once, automate it”, I created a batch file and scheduled it with Windows Task Scheduler to run ever day. Just change the folder path below and you can do the same thing.

 

@echo off
REM cleanup the test results folder
set folder="C:\tfs\MyProject\TestResults"
IF EXIST %folder% (
  echo %folder% exists
  cd /d %folder%
  for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)
) else (
  echo %folder% does not exist
)
Posted on Tuesday, January 13, 2015 5:04 PM Productivity , Unit Testing , UI Automated Testing , Selenium | Back to top


Comments on this post: Cleanup your TestResults folder with a Scheduled Task

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Aligned | Powered by: GeeksWithBlogs.net