use of com.testsigma.automator.drivers.DriverManager in project testsigma by testsigmahq.
the class TestcaseRunner method startNewDriverSession.
private boolean startNewDriverSession() {
boolean shouldStart = false;
DriverManager driverManager = DriverManager.getDriverManager();
String capabilityStr = hasDriverSession();
String currentSessionId = DriverManager.getDriverManager().getDriver().getRemoteWebDriver().getSessionId().toString();
if (driverManager != null) {
shouldStart = driverManager.getRestartDriverSession() || currentSessionId == null || (currentSessionId != null && capabilityStr == null);
}
return shouldStart;
}
use of com.testsigma.automator.drivers.DriverManager in project testsigma by testsigmahq.
the class TestsuiteRunner method restartCurrentSession.
private void restartCurrentSession(TestSuiteResult testSuiteResult) {
if (workspaceType.equals(WorkspaceType.Rest)) {
return;
}
DriverManager driverManager = DriverManager.getDriverManager();
if (driverManager.isRestart() && (driverManager.getRestartSessionId() != null)) {
try {
log.info("Found that driver session restarted while executing a test suite. Storing session ID " + "in test suite result tables. Test Suite Result - " + testSuiteResult.getId());
driverManager.storeSessionId(DriverSessionType.TEST_SUITE_SESSION, testSuiteResult.getId());
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
use of com.testsigma.automator.drivers.DriverManager in project testsigma by testsigmahq.
the class WebTestcaseStepRunner method onStepFailure.
@Override
protected void onStepFailure(ExecutionLabType exeType, WorkspaceType workspaceType, TestPlanRunSettingEntity settings) throws AutomatorException {
if (workspaceType.equals(WorkspaceType.WebApplication)) {
DriverManager manger = DriverManager.getDriverManager();
manger.performCleanUpAction(settings.getOnAbortedAction());
}
}
use of com.testsigma.automator.drivers.DriverManager in project testsigma by testsigmahq.
the class TestcaseRunner method restartCurrentSession.
private void restartCurrentSession() throws AutomatorException {
if (workspaceType.equals(WorkspaceType.Rest)) {
return;
}
DriverManager driverManager = DriverManager.getDriverManager();
if (startNewDriverSession()) {
log.info("Found startNewDriverSession flag to be true. Starting a new driver session.");
driverManager.endSession();
driverManager.startSession(DriverSessionType.TEST_CASE_SESSION, testCaseResult.getId(), Boolean.TRUE);
driverManager.setRestartDriverSession(Boolean.FALSE);
} else {
log.info("Found startNewDriverSession flag to be false. Continuing with the existing driver session.");
if (driverManager.isRestart()) {
driverManager.storeSessionId(DriverSessionType.TEST_CASE_SESSION, testCaseResult.getId());
}
}
}
Aggregations