Automatically close the windows in Java application #60
ManikandanSuryaprakasam
started this conversation in
General
Replies: 2 comments
-
i used os.system("taskkill /im java.exe /f") it works for me to close all the java windows. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can use as below:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After opening the dialogs and Frames using pyjab.I'm trying to close the windows automatically after every test when there is any exception or test is passed in pytest. Any idea how to do it automatically.
@gaozhao1989 @szczepanR
1.Tried using JABdriver list
def window_idenfier(self,wintitle)
window = JABDriver(title=wintitle)
windowlist.append(window) #i'm able to get the JABDrivers in a windowlist
return window
I'm able to print the windowlist.But not able to close those windows at end of the test.I tried by using
try:
{#appcode}
,except:,
print(windowlist)
for i in windowlist
i.close # i tried with multiple combination JABdriver(i).exit and
finally:
print(windowlist)
for i in windowlist
i.close # i tried with multiple combination JABdriver(i).exit not working
2.Tried with Os.kill.
hwndt = Win32Utils.enum_windows()
for d in hwndt:
print(d, hwndt[d])
if hwndt[d] == "windowtitle":
os.kill(d, signal.SIGKILL)
E AttributeError: module 'signal' has no attribute 'SIGKILL'.Some type error it is displaying.c_type
Please suggest a way to close the windows automatically.To close only the windows of java application at end of each test.Similar to browser exit in selenium.
Beta Was this translation helpful? Give feedback.
All reactions