I've created a series of automated tests using the click and record function of test complete. I've strung my tests together, and after each has run I've created another test 'IEKill', This is another click and record test which basically opens up command prompt and runs the following: taskkill /F /IM iexplore.exe /T
This is supposed to kill and close down all IE processes, but its not working. It'll run, but once the command has been issued, IE remains active. Note: I'm running my tests in a W10 environment, using IE11.
I need a way of killing IE once my automated test has run. I'd assume that test complete focuses into the browser somehow which means when issuing a kill command it cant be killed off .
Any help is appreciated.
We call the following at the end of every IE test case.
function closeIEInstance() { var counter = 0; var browser; browser = Sys.WaitBrowser('iexplore', 1000); while((browser.Exists) && (counter < 60)){ counter++; browser.Terminate(); browser = Sys.WaitBrowser('iexplore', 1000); } }
How would i go about implementing that command? Bearing in mind i'm keyword testing, not writing the tests myself.
1) Create a script unit
2) Add that code to the script unit
3) call "Run Script Routine" operation within your keyword test to run that code.
Hi,
Here is our implementation in python:
def kill_redundant_browser_process(process_name): Sys.Refresh() if Sys.WaitProcess('{}'.format(process_name), 1000).Exists: Sys.Browser(process_name).Close() Sys.Refresh() if Sys.WaitProcess('{}'.format(process_name)).Exists: Sys.WaitProcess('{}'.format(process_name)).Terminate() Log.Message("The redundant '{}' process was killed".format(process_name))
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 |
Subject | Author | Latest Post |
---|---|---|