Reputation: 111
While automating I'm required to click on Edit Excel, make the changes and again open it to see if the changes have been made. When I click on edit excel, the excel opens. I do the changes inside the code. How do I close the opened excel in selenium. Any help is much appreciated.
Upvotes: 0
Views: 2073
Reputation: 3927
It looks like on clicking Edit Excel, excel file opens and need to close that one right? so here we are not opening the file by java code just like FileInputStream etc... so i think we can close directly from cmd... just like below
Runtime.getRuntime().exec(
"cmd /c taskkill /f /im excel.exe");
Thank You, Murali
Upvotes: 1