Search in sources :

Example 1 with WebDriverSettingsDTO

use of com.testsigma.agent.dto.WebDriverSettingsDTO in project testsigma by testsigmahq.

the class DriverSessionsService method createSession.

public String createSession(DriverSessionRequest driverSessionRequest) throws Exception {
    com.testsigma.agent.dto.WebDriverSettingsDTO webDriverSettingsDTO;
    if (ExecutionLabType.Hybrid.equals(driverSessionRequest.getExecutionLabType()) && WorkspaceType.isMobileApp(driverSessionRequest.getWorkspaceType())) {
        disconnectDeviceSession(driverSessionRequest.getUniqueId());
        driverSessionRequest.setWebDriverServerUrl(new URL(mobileAutomationServer.getServerURL()));
    }
    webDriverSettingsDTO = fetchWebDriverSettings(driverSessionRequest);
    log.info("Creating a remote web driver session with settings - " + webDriverSettingsDTO);
    TestsigmaDriver testsigmaDriver = getDriverInstance(driverSessionRequest);
    List<WebDriverCapability> caps = webDriverSettingsDTO.getWebDriverCapabilities();
    addMissingTimeOutCapability(caps);
    handleLocalDevice(caps, driverSessionRequest);
    setRemoteServerURL(testsigmaDriver, driverSessionRequest, webDriverSettingsDTO);
    testsigmaDriver.setCapabilities(caps);
    RemoteWebDriver remoteWebDriver = testsigmaDriver.createSession();
    String sessionId = populateSessionIdMaps(remoteWebDriver, driverSessionRequest);
    sendMobileSessionStartedRequest(sessionId, driverSessionRequest);
    return sessionId;
}
Also used : WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability) RemoteWebDriver(org.openqa.selenium.remote.RemoteWebDriver) TestsigmaDriver(com.testsigma.automator.drivers.TestsigmaDriver) URL(java.net.URL) WebDriverSettingsDTO(com.testsigma.agent.dto.WebDriverSettingsDTO)

Aggregations

WebDriverSettingsDTO (com.testsigma.agent.dto.WebDriverSettingsDTO)1 TestsigmaDriver (com.testsigma.automator.drivers.TestsigmaDriver)1 WebDriverCapability (com.testsigma.automator.drivers.WebDriverCapability)1 URL (java.net.URL)1 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)1