Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Driver.close()/quit() not work #86

Closed
quangnt opened this issue Mar 17, 2016 · 13 comments
Closed

Driver.close()/quit() not work #86

quangnt opened this issue Mar 17, 2016 · 13 comments
Labels

Comments

@quangnt
Copy link

quangnt commented Mar 17, 2016

After launching app, even if call driver.close() or driver.quit() it doesn't kill launched app and throw Error: self.driver.quit()
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 483, in quit
self.execute(Command.QUIT)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 201, in execute
self.error_handler.check_response(response)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 181, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: Message: Process has exited, so the requested information is not available.

@skyline-gleb
Copy link
Contributor

@quangnt Hi! As I understand it, your PR #107 fix it?

@Nishanthshettar
Copy link

@skyline-gleb I upgraded to latest Winium release v1.6.0, but still when I do driver.quit() / close (), it's not quitting the app.

Error is same: Message: org.openqa.selenium.WebDriverException: Process has exited, so the requested information is not available. (WARNING: The server did not provide any stacktrace information)

Am using the .LNK (C:\Users\xxx\Desktop\yyy.lnk) to open an app.

If I use C:\Users\xxx\Desktop\yyy.exe IT WORKS, since I need to take a .LNK, it fails.

Could you please check ?, Thanks in advance.

@NickAb
Copy link
Contributor

NickAb commented Oct 7, 2016

@Nishanthshettar, could you please write down why do you need to launch app under a test using .LNK? Do you need to pass arguments to the app under a test?

@skyline-gleb, I think one sure way to close all processes started during Winium session would be to use a trick similar to one used by Jenkins: Winium should setup some environment variable like WINIUM_SESSION={SESSION_GUID} before starting the app under a test. This way any process started by app under a test should inherit same environment variable. Then it would be only a matter of iterating processes and checking their environments. But quick googling suggests that it will require at least using some system dll and some wrapping code to marshal calls.

@skyline-gleb
Copy link
Contributor

@Nishanthshettar really, only exe format supported correctly, now.

@skyline-gleb
Copy link
Contributor

@NickAb yes, that's like on work approach, but .lnk, is there a need, i dont know

@Nishanthshettar
Copy link

@NickAb Reason to use .lnk is, we use Auto update Squirrel Software, whenever we build Windows App in Jenkins, Squirrel will update the App (so it takes new Developer changes) so if I provide a .lnk, it will always takes new builds.

@skyline-gleb Yes, .exe format works perfectly fine, but if I have to continue with .exe, everytime I need to download the new build from Jenkins and provide a path to .exe (this is overkill, In a day we build 2 to 3 times Windows app).

To run my Windows tests, it would be great help if I get a workaround to use .lnk and also do tearDown() with driver.close / quit.

Thanks in advance.

@skyline-gleb
Copy link
Contributor

@Nishanthshettar okay, i get it. Subscribe to #129

@Athmeeya
Copy link

Even i am facing issue while closing the driver using driver.quit() ;
I was working with calculator:
getting following exception:
Exception in thread "main" org.openqa.selenium.WebDriverException: Process has exited, so the requested information is not available. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 58 milliseconds
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'INENNRA4L2C', ip: '192.168.1.101', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.winium.WiniumDriver
Capabilities [{app=C:\Windows\System32\calc.exe, args=, innerPort=9998, debugConnectToRunningApp=false, keyboardSimulator=1, launchDelay=0, platform=ANY}]
Session ID: AwesomeSession
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:670)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:516)
at com.winium.demo.MyFirstTestCase.main(MyFirstTestCase.java:30)

@avian27
Copy link

avian27 commented Nov 26, 2018

Even I am facing the same issue what Athmeeya said. Whats the solution to the above issue as it has been marked closed

@sameeksha-sahib
Copy link

I am facing the issue too..

@MaksimYaginov
Copy link

I am facing the issue too

@ykolodiy
Copy link

ykolodiy commented Feb 8, 2019

Im just closing an app using kill command
in java: Runtime.getRuntime().exec("TASKKILL /F /IM calculator.exe");

@vijay587
Copy link

Even i am facing issue while closing the driver using driver.quit() ;
I was working with calculator:
getting following exception:
Exception in thread "main" org.openqa.selenium.WebDriverException: Process has exited, so the requested information is not available. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 58 milliseconds
Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'
System info: host: 'INENNRA4L2C', ip: '192.168.1.101', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.winium.WiniumDriver
Capabilities [{app=C:\Windows\System32\calc.exe, args=, innerPort=9998, debugConnectToRunningApp=false, keyboardSimulator=1, launchDelay=0, platform=ANY}]
Session ID: AwesomeSession
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:647)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:670)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:516)
at com.winium.demo.MyFirstTestCase.main(MyFirstTestCase.java:30)

I believe the problem is with your local host which stops working and throws an exception.
I am also new in this I found same issue but resolved after setup host settings and run winium drivers as an administrator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants