Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
725 views
by Contributing Tester (16 points)
retagged by
I am using a batch file for running the tests and for the remote machine I don't have access to. So how to close browser and driver in remote machine?

I tried the "taskkill" command.

1 Answer

1 like 0 dislike
by The go-to Tester (222 points)
selected by
 
Best answer

In the local machine, if not closed by Selenium WebDriver quit() method, you can use batch commands specified below to close browser windows.

taskkill /im chromedriver.exe 

and

taskkill /im chrome.exe

In order to close browser on the remote machine, you should make sure that driver.exit() executes after the end of every test. You can catch all possible exceptions and throw it only after your WebDriver instance closes the browser window.

If at all if browser window does not close, you must log in to the machine via RDP and execute the batch command.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...