
com.infotel.seleniumrobot.grid.tasks.KillTask Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of seleniumRobot-grid4 Show documentation
Show all versions of seleniumRobot-grid4 Show documentation
Selenium grid extension for mobile testing
The newest version!
package com.infotel.seleniumrobot.grid.tasks;
import com.seleniumtests.util.osutility.OSUtilityFactory;
public class KillTask implements Task {
private String taskName;
private Long taskPid;
public KillTask withName(String taskName) {
this.taskName = taskName;
return this;
}
public KillTask withPid(Long taskPid) {
this.taskPid = taskPid;
return this;
}
@SuppressWarnings("unchecked")
@Override
public KillTask execute() throws Exception {
if (taskName != null) {
OSUtilityFactory.getInstance().killProcessByName(taskName, true);
} else if (taskPid != null) {
OSUtilityFactory.getInstance().killProcess(taskPid.toString(), true);
}
taskName = null;
taskPid = null;
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy