How to close browser after being opened from native app [Android]

In my test, there is a button that takes you outside of the app and opens up a browser link. Now, after the test verifies I’m taken to the browser, I want to close the browser.I tried driver.close() but it throws this error at me and fails the test:

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to remote server. Original error: 404 - undefined

driver.quit() will not fail the test, but it will only close the app and not the browser. Is there any way to get it to close? This is crucial because I need to be able to start another test right after this one or even rerun the same test, and having this webpage open causes failures. Please help!

terminateApp should help

1 Like

It worked, thank you!

Why doesn’t it work on me?