Search in sources :

Example 1 with DriverManager

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;
}
Also used : DriverManager(com.testsigma.automator.drivers.DriverManager)

Example 2 with DriverManager

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);
        }
    }
}
Also used : DriverManager(com.testsigma.automator.drivers.DriverManager) AutomatorException(com.testsigma.automator.exceptions.AutomatorException)

Example 3 with DriverManager

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());
    }
}
Also used : DriverManager(com.testsigma.automator.drivers.DriverManager)

Example 4 with DriverManager

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());
        }
    }
}
Also used : DriverManager(com.testsigma.automator.drivers.DriverManager)

Aggregations

DriverManager (com.testsigma.automator.drivers.DriverManager)4 AutomatorException (com.testsigma.automator.exceptions.AutomatorException)1