I have several Selenium tests being run remotely from Jenkins (on Linux) to a Windows machine using Selenium Grid. I need a way to reliably kill
all instances of IE before a test even begins. These tests all run end-to-end using TestNG, so this method needs to be executed at the beginning of each test, in the @BeforeMethod
. I know how to use Java to kill
the tasks, but since the code is actually deployed on a Linux machine those won't work (to my knowledge). Any help would be appreciated!
Kill instances of Internet Explorer remotely from linux machine using Java
161 views Asked by kroe761 At
3
There are 3 answers
0
On
You can use winrm4j to execute commands from java code on remote windows box. Something like:
WinRmTool.Builder cmdTool = createWinRmBuilder();
cmdTool.environment(environment);
WinRmToolResponse cmdResponse = cmdTool.build().executeCommand("taskkill /F /IM iexplore.exe /T");
0
On
You can either use some remote management tools for that, or just create a micro service, which will be running on a target workstation and accept http requests with commands for remote file system / tasks management.
Check this article, which describes how to build a simple service and Jenkins plugin for such kind of tasks. There're links on sources as well.
create a bat file on Windows PC and write the following line
it will kill all the instances of Internet Explorer. Now everytime you want to make sure all the internet explorer instances are closed. Run this bat file