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;
}
Aggregations