Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete temporary files which is generated during selenium webdriver runs?

Can anyone help me to delete the temporary files generated during the web driver test runs? i am using selenium web driver 1.25 and IE 7.Implementing my test in java.

like image 362
Karthikeyan Avatar asked Mar 03 '13 10:03

Karthikeyan


People also ask

How do I delete a file using selenium?

You can make the download folder shared. \youruser\downloads after that you can pass this path to the File. Delete(); and it will delete the desired files.

How do I search and delete temporary files from running?

Step 1: Press Windows key + R to open the Run command. Then type “%temp%” in the search field and press OK. Step 2: Now, select all local temp files using ctrl + A and then press delete.

Which command is used to clean up temporary files?

Enter %temp% from Search/Run, and delete what's in there. Also empty the Recycle Bin. Alternatively, use a command line command. Save rd %temp% /s /q in a text file with the .


2 Answers

Be sure you call

driver.quit();

instead of

driver.close();

close() will not delete temporary files

like image 191
Pavan Gupta Avatar answered Sep 19 '22 16:09

Pavan Gupta


The temporary files are deleted automatically once you had used driver.quit() in the latest versions of Webdriver. Can't be sure. Is it 1.25 or 2.25 ?

like image 30
Harshavardhan Konakanchi Avatar answered Sep 17 '22 16:09

Harshavardhan Konakanchi